• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 2. CSS > Overriding Inheritance

Overriding Inheritance

In the previous example, all elements were given the same font style through inheritance. Sometimes, however, children don’t look like their parents. Not surprisingly, CSS also accounts for this. Say you want H1 elements to be in italic and the rest of the text to be normal. This is easily expressed in CSS:

<style TYPE="text/css">
  body { font-style: italic }
  h1 { font-style-normal }
</style>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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