HTML and CSS Reference
In-Depth Information
3.1 OBJECT-ORIENTED PROGRAMMING INHERITANCE
Though beyond the scope of this article, CSS inheritance shouldn't be
confused with object-oriented programming (OOP) inheritance. Here is the
definition of OOP inheritance from Wikipedia, and it makes clear that we are
not talking about the same thing:
In object-oriented programming (OOP), inheritance is a way to form new
classes […] using classes that have already been defined. Inheritance is
employed to help reuse existing code with little or no modification. The
new classes […] inherit attributes and behavior of the pre-existing
classes. …
3.2 HOW INHERITANCE WORKS
When an element inherits a value from its parent, it is inheriting its computed
value. What does this mean? Every CSS property goes through a four-step
process when its value is being determined. Here's an excerpt from the
W3C specification:
The final value of a property is the result of a four-step calculation: the
value is determined through specification (the “specified value”), then
resolved into a value that is used for inheritance (the “computed value”),
then converted into an absolute value if necessary (the “used value”),
and finally transformed according to the limitations of the local
environment (the “actual value”).
Search WWH ::




Custom Search