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

Chapter 4. CSS Selectors > Combining Selector Types

Combining Selector Types

So far, three kinds of selectors have been described in this chapter: Type selectors, ID selectors, and class selectors. Often, different selector types are combined to form more complex selectors. By combining selectors, you can more accurately target elements that you want to give a certain presentation. For example, by combining a type selector and a class selector, an element must fulfill both requirements: It must be of the right type and the right class in order to be influenced by the style rule. Figure 4.7 shows one example.

Figure 4.7. A combined type and class selector.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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