Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

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

7.6. Chapter review

I hope you have found this a useful chapter. Dividing a page into sections and assigning an ID to each section gives you the freedom to apply different styles through the use of descendant selectors. Also, combining the float property with a deep margin makes it possible to create columns. Modern browsers handle floats in their stride, but older versions of Internet Explorer have considerable problems. Fortunately, they can usually be overcome by removing the fixed width on the static column alongside the floated one. The addition of the sidebar to the case study makes the page look more like a regular website.

Finally, you learned how to calculate specificity, which determines the precedence of style rules. In general terms, ID selectors are more powerful than classes, and type selectors are the weakest of all. However, more powerful selectors override only those properties that are explicitly declared. If a style with higher specificity doesn't work the way you expected, it probably means it's inheriting a property from another style, as happened with text-decoration when styling the links for the sidebar.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint