Chapter 8

More Cascading Style Sheets

What You Will Learn in this chapter

  • Styling links
  • Setting document backgrounds
  • Styling bullet points and numbered lists
  • Changing the appearance of tables
  • Adjusting the outlines around boxes
  • Adding content to the HTML document before or after an element
  • Understanding three positioning schemes that enable you to determine where on a page a box appears Code Downloads for this Chapter

The code downloads for this chapter are found at on the Download Code tab. The code is in the Chapter 8 download and individually named according to the names throughout the chapter.

In this chapter, you continue to learn how to use CSS to control the presentation of HTML web pages, starting with CSS properties that enable you to control the presentation of links, backgrounds, list styles, table styles, and outlines around boxes. You then learn a technique to add content to a page (even if it were not in the HTML document) using the :before and :after pseudo-classes. Finally, you see how to use CSS to position boxes on the page, which enables you to create attractive layouts for your pages.


By default, most browsers show links in blue with an underline and change the color of links you have already visited, unless you tell them to do otherwise. The following are properties often used with links:

  • color: Changes the colors of the links
  • background-color: Highlights the link, as if it had been highlighted ...

Get Beginning HTML and CSS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.