CSS - Inheritance

About

Style properties are inherited by an element’s descendants unless otherwise specified.

Example

  • The HTML
<div>
   <p>
        My parent div element got the style property through the CSS rule 
        and I, the p element, inherit its properties because I'm one of its descendant 
   </p>
   <div>
        <p>
        I'm also a descendant, second level :)
        </p>
   </div>
</div>
  • The Css
div { color: blue; }
  • The result:





Discover More
CSS - (Implementation|Processing Model|Rendering)

How user agents may implements CSS. A user agent processes a source by going through the following steps: Parse the source document and create a document tree (CSSOM) Identify the target media...
CSS - line-height Property

On block level elements, the line-height property specifies the space between the text lines and is known as the Leading where: the value is one of: normal, - let the browser choose a reasonable...
HTML - HTML element (Document root)

The html element represents the root of a a html document (page). It would become also the root (top node) in the in-memory tree representation (DOM document) of this html page. This is also the node...



Share this page:
Follow us:
Task Runner