NextIndex

Programs in CSS

1. Creating Horizontal menu using CSS.


style.css



#menubar{

	width:680px;

	height:40px;

	background-color:#333;

}

#menubar ul{

	list-style-type:none;

	padding-left:0;

}

#menubar ul li{

	display:inline;

}

#menubar ul li a{

	width:136px;

	color:#FFF;

	text-decoration:none;

	float:left;

	text-align:center;

	line-height:40px;

}

#menubar ul li a:hover{

	color:#39F;

	background-color:#000;

}



css_menu.html

<body>

<div id="menubar">

    <ul>

    <li><a href="#">Home</a></li>

    <li><a href="#">About</a></li>

    <li><a href="#">Projects</a></li>

    <li><a href="#">Features</a></li>

    <li><a href="#">Contact</a></li>

    </ul>

</div>

</body>

Output :





Developed by


World Wide Web Consortium

World Wide Web Consortium

Google+