Chapter 16. Creating Horizontal Navigation

In this lesson, you will learn how to create horizontal navigation from a standard HTML list. You will also learn how to float the <ul> element to create a navigation bar and float the <a> element to create a series of square buttons—each with a thin dividing line down its right edge.

Styling the List

To style this list, you will need to use selectors that target the <ul>, <li>, and <a> elements. You will also need to include the unique identifier, navigation, within each selector. The four selectors that you will use are shown in Listing 16.1. The HTML code is shown in Listing 16.2.

Example 16.1. CSS Code Showing the Selectors for Styling the List

ul#navigation {...} ul#navigation li {...} ul#navigation ...

Get Sams Teach Yourself CSS in 10 Minutes now with O’Reilly online learning.

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