1. Home
  2. Computing & Technology
  3. Web Design / HTML

About Web Design Book Chapter 8 - Example 8-2

Here is the code for example 8-2 in the About Web Design book.

The Page | The HTML | The Stylesheet

The HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Dogs and Their Toys Navigation</title>
<link type="text/css" href="zexample8-2.css" rel="stylesheet" />
</head>
<body>
<ul id="navigation">
<li><a href="/index.html">Home</a></li>
<li><a href="/products/index.html">Dog Toys for Sale</a></li>
<li><a href="/articles/index.html">Dog Information</a></li>
<li><a href="/about/index.html">About this Site</a></li>
</ul>
</body>
</html>

If you notice, the HTML hasn't changed from the first example.

The Stylesheet (CSS)

ul#navigation {
  list-style: none;
  margin: 0;
  padding: 0;
}
ul#navigation li {
  margin: .1em 0;
}
ul#navigation li a {
  display: block;
  width: 175px;
  height: 20px;
  border: .1em solid #3c6;
  text-decoration: none;
  color: #000;
  font-weight: bold;
  text-align: center;
}

Here's what the page looks like.

Jennifer Kyrnin
Explore Web Design / HTML
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML

©2010 About.com, a part of The New York Times Company.

All rights reserved.