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

4.7. Styling Lists

Our standard navigation list can benefit from a little more styling. By default, the bullet points are small black blobs, but you can change these easily to different predefined shapes. Let’s head back to our project’s stylesheet to see how this works.

  1. In style1.css, find the <li> element selector.

  2. Add the following declaration (new addition shown in bold):

    listing 4-24. style1.css (excerpt)

    li {
      font-size: small;
      list-style-type: circle;
    }

  3. Save the CSS file and refresh the view in your browser.

  4. Change the value of list-style-type to disc, square, and none, saving the CSS file after each change, and checking each page display in the browser. We’ll stick with the none option on our project site, which should look like Figure 4-40.

Figure 4-40. Applying different list-bullet styles in CSS—even none


It’s possible to use CSS to style lists to a greater extent, including:

  • making the links appear as buttons by utilizing the CSS border and padding properties

  • creating a larger clickable area for the link (rather than just the text itself)

  • setting list items out in a horizontal line

These more advanced techniques are discussed and explained thoroughly in The CSS Anthology: 101 Essential Tips, Tricks & Hacks by Rachel Andrew. The book devotes almost a whole chapter to styling navigation, and presents many styles that you can try out. I strongly advise you to grab a copy if you want to learn some really cool CSS tricks (once the basics are under your belt, of course!).

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