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... > So, how do selections really work?

So, how do selections really work?

You’ve seen how to select an element to style it, like this:

image with no caption

Or, how to select more than one element, like this:

image with no caption

You’re going to see that CSS allows you to specify all kinds of selectors that determine which elements your styles are applied to. Knowing how to use these selectors is the first step in mastering CSS, and to do that you need to understand the organization of the XHTML that you’re styling. After all, how can you select elements for styling if you don’t have a good mental picture of what elements are in the XHTML, and how they relate to one another?

So, let’s get that picture of the Lounge XHTML in your head, and then we’ll dive back into selectors.

Markup Magnets

Remember drawing the diagram of HTML elements in Chapter 3? You’re going to do that again for the Lounge’s main page. Below, you’ll find all the element magnets you need to complete the diagram. Using the Lounge’s XHTML (on the right), complete the tree below. We’ve done a couple for you already. You’ll find the answer in the back of the chapter.


  

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


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