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 the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.