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 odpowiedzi
+ 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