Tutorials HTML and CSS Tutorials Navigation Bar in HTML

Navigation Bar in HTML Tutorials Dec 07, 2005

Now we're gonna create a navigation bar in html. Copy the following code into the HEAD of your script.

navigation bar in html

<style type="text/css">

.hovermenu ul{
font: bold 13px arial;
padding-left: 0;
margin-left: 0;
height: 20px;

.hovermenu ul li{
list-style: none;
display: inline;

.hovermenu ul li a{
padding: 2px 0.5em;
text-decoration: none;
float: left;
color: black;
background-color: #FFF2BF;
border: 2px solid #FFF2BF;

.hovermenu ul li a:hover{
background-color: #FFE271;
border-style: outset;

html>body .hovermenu ul li a:active{ /* Apply mousedown effect only to NON IE browsers */
border-style: inset;

Copy the following code into the BODY of your script.

<div class="hovermenu">
<li><a href="">title 1</a></li>
<li><a href="">title 2</a></li>
<li><a href="">title 3</a></li>
<li><a href="">title 4</a></li>
<li><a href="">title 5</a></li>

subscribe to newsletter