How Do I Create Differently Styled Sections?

  • David Powers


Way back in Chapter 1, I warned you that it’s easy to slip into the habit of overusing CSS classes. If you examine the style sheet used in this book’s main case study (you can find it in css/journey_20.css in the download files for this chapter), you’ll see that it uses classes very sparingly. Instead, I have relied on using type selectors to redefine the default look of HTML tags. I have also used the adjacent sibling selector-such as h1+p, which styles a paragraph only if it comes immediately after an 〈h1〉 heading—to target certain elements without the need to add class attributes to the HTML markup. Other selectors used so far include ID selectors, descendant selectors, and pseudo-classes.


Background Image Main Content Grand Canyon Left Margin Head Image 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© David Powers 2009

Authors and Affiliations

  • David Powers

There are no affiliations available

Personalised recommendations