Every CSS property must have a value.
Is there a cascaded value?
-if yes,
Specified value == Cascaded value
-if not,
Is the property inherited?(specific to each property)
and if yes,
Specified value == Computed value of parent element
∴ This is Inheritance!
if not,
Specified value == Initial value(specific to each property)
- like padding and margin -> not inherited. be extremely impracticable.
- Inheritance passes the value for some specific properties from parents to children - more maintainable code!
- Properties related to text are inherited : font-family, font-size, color, etc.
- The computed value of a property is what gets inherited, not the declared value.
- Inheritance of a property only works if no one declares a value for that property.
- The inherit keyword forces inheritance on a certain property.
- The initial keyword resets a property to its initial value.
'Frontend 👩🏻💻 > HTML&CSS' 카테고리의 다른 글
[Sass] Architect : the 7 - 1 pattern (0) | 2018.07.20 |
---|---|
[css] the problem of setting the font-size to pixels of body element (0) | 2018.07.15 |
[css] How UNITS are converted from relative to absolute(px) (0) | 2018.07.13 |
[css] How CSS Works? and what is Specificity? (0) | 2018.07.12 |
px, %, rem, em 변환과정 (0) | 2017.12.27 |