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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

8. Getting Started with CSS: Adding a Li... > The world’s smallest & fastest guide...

The world’s smallest & fastest guide to how styles are applied

Elements and document trees and style rules and classes... it can get downright confusing. How does all this stuff come together so that you know which styles are being applied to which elements? As we said, to fully answer that you’re going to have to know a little more about CSS, and you’ll be learning that in the next few chapters. But before you get there, let’s just walk through some common sense rules-of-thumb about how styles are applied.

First, do any selectors select your element?

Let’s say you want to know the font-family property value for an element. The first thing to check is: is there a selector in your CSS file that selects your element? If there is, and it has a font-family property and value, then that’s the value for your element.


  

You are currently reading a PREVIEW of this book.

                                                                                        

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

  

Start a Free Trial