• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Inheritance

Inheritance is a key concept in CSS. Most style properties are passed down from parent to child elements, although margins do not inherit. Descendants of an element in the document tree inherit their parent's style properties. Suppose that you style all h1 elements to be red, as follows:

h1 {color: red;} 

<h1>Hiermenus <em>Central</em></h1>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint