color: red;
is applied to a div element, then that declaration will also apply to p elements that are within it.Inherited properties have no specificity at all, not even zero. An inherited property is overridden by values applied to the property using the universal selector (*). This is because the universal selector has a specificity of zero.
Most of the properties that apply to the "box" of an element such as borders, margins, padding and backgrounds, are not inherited by descendants of that element.
No comments:
Post a Comment