0
CSS Inheritance
But the mydiv didn't mention the p element in it. So way the p get to style as mydiv?
1 Answer
+ 1
In CSS style is inherited. If you apply a style to body then it will also be applied to entire page.
Ex;
body
{
color: white;
}
above snippet will color text, border, etc white until overwritten. This rule is same for all parent and child elements.