a simple navigation menu

An Elegant Horizontal Menu – CSS

“An Elegant Horizontal Menu – CSS” is a simple example of a navigation menu through using HTML and CSS.

DEMO LINK: http://parhammajd.co.uk/examples/css/horizontalMenu.html



<!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=utf-8" />
<title>Horizontal Menu</title>
<style>
#navsite p {
display:none;
}
#navsite ul {
width:100%;
float:left;
padding:0;
margin-left:0;
border-bottom:1px solid #778;
font:bold 12px Verdana, Geneva, sans-serif;
}
#navsite ul li {
list-style-type:none;
margin:0;
float:left;
}
#navsite ul li a {
padding:12px 0.5em;
margin-left:3px;
border:1px solid #778;
border-bottom:none;
background-color:#666;
text-decoration:none;
display:block;
width:7em;
}
#navsite ul li a:link {
color:white;
}
#navsite ul li a:visited {
color:667;
}
#navsite ul li a:link:hover, #navsite ul li a:visited:hover {
color:#000;
background-color:#aae;
border-color:#227;
}
#navsite ul li a#current {
background:red;
border-bottom:1px solid red;
}
.clearfloat:after {
content: ".";
display:block;
height: 0;
clear:both;
visibility:hidden;
}
/* CSS for IE6 */
*html .clearfloat {
height: 1%;
}
/* CSS for IE7 */
*:first-child+html .clearfloat {
min-height:1px;
}
</style>
</head>

<body>
<div id="navsite" class="clearfloat">
<p>Site navigation</p>
<ul>
<li><a href="#" id="current">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Archives</a></li>
<li><a href="#">Portfolio</a></li>

<li><a href="#">Contact</a></li>
</ul>
</div>
</body>
</html>

 


One thought on “An Elegant Horizontal Menu – CSS

Leave a Reply

Your email address will not be published. Required fields are marked *