0
Inheritance in CSS
<head><style> body{Color:green;} .div{color:Red;} </style> </head> <body> <div class="div"> <p> this is some text</p> </div> </body> Now Why the Paragraph in the Body section uses red color instead of green which is defined as a color for the body section.
2 Respostas
+ 2
Divs are separated of the body , the <p> will give the precedence to the div style .
And actually this is why we use divs
0
Answer is RED.
EXPLANATION: Though the body tag is specfied with green color , the p tag in the div section takes the priority of .div(class selector) defined with color:red first.Hence "this is some text" is diplayed in red color...