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

Chapter 2. CSS > Properties That Don’t Inherit

Properties That Don’t Inherit

As a general rule, properties in CSS inherit from parent to child elements as described in the previous examples. Some properties, however, don’t inherit and there is always a good reason why. We use the background property (which is described in Chapter 10, “Colors”) as an example of a property that doesn’t inherit.

Say you want to set a background image for a page. This is a common effect on the Web. In CSS, you can write the following:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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