<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>CSS Newbie Example: A Full-Width Centered Navigation Bar</title>
<style>
#nav {
width: 100%;
float: left;
margin: 0 0 1em 0;
padding: 0;
background-color: #f2f2f2;
border-bottom: 1px solid #ccc; }
#nav ul {
list-style: none;
width: 800px;
margin: 0 auto;
padding: 0; }
#nav li {
float: left; }
#nav li a {
display: block;
padding: 8px 15px;
text-decoration: none;
font-weight: bold;
color: #069;
border-right: 1px solid #ccc; }
#nav li:first-child a {
border-left: 1px solid #ccc; }
#nav li a:hover {
color: #c00;
background-color: #fff; }
/* This is just styling for this specific page. */
body, html {
margin: 0;
padding: 0; }
body {
background-color: #555;
font: small/1.3 Arial, Helvetica, sans-serif; }
#wrap {
clear: left;
width: 800px;
padding: 0;
margin: 0 auto;
background-color: #fff; }
h1 {
font-size: 1.5em;
padding: 1em 8px;
color: #333;
background-color: #069;
margin: 0; }
#content {
padding: 0 50px 50px; }
</style>
</head>
<body>
<!-- Here's all the HTML you need to create this navigation bar. -->
<div id="nav">
<ul>
<li><a href="#">About Us</a></li>
<li><a href="#">Our Products</a></li>
<li><a href="#">FAQs</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Login</a></li>
</ul>
</div>
<!-- That's it! Everything else on the page follows below. -->
<div id="wrap">
<h1>A Full-Width Centered Navigation Bar</h1>
<div id="content">
<p>The navigation bar above stays centered over our content area here, but still manages to stretch the full width of the browser window. And it only requires one extra div!</p>
<p>The navigation bar design is a take off the <a href="http://www.cssnewbie.com/super-simple-horizontal-navigation-bar/">Super Simple Horizontal Navigation Bar.</a> To learn how to build this navigation bar, <a href="http://www.cssnewbie.com/full-width-centered-navigation-bar/">see the original article here.</a></p>
</div>
</div>
</body>
</html>