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

Inheritance

Just like the money you hope you'll get from rich Uncle Dick, inheritance in CSS involves passing something down from ancestors to descendants. But, rather than the mountain of green drinking vouchers you hope to get upon the sad, but strangely longed-for, demise of generous old Dickie, in the case of CSS, what is inherited is the values of various CSS properties.

You may remember from our discussion on the document hierarchy in Chapter 1 that the body tag is the great-ancestor of them all—all CSS-targeted tags in your markup descend from it. So, thanks to the power of CSS inheritance, if you style the body tag like this


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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