Create a horizontal menu in CSS and HTML

This is a tutorial for beginners. In this tutorial I will explain how you can easily create a horizontal menu by using CSS and HTML.

To create a horizontal menu in HTML, you must use this code:

<ul id="menu">

<li>First option</li>

<li>Second option</li>

</ul>

Next, create a CSS file or open the CSS file and add this code:

#menu{

background-color:#6633FF;

width:auto;

height:50px;

}

#menu ul{

margin:0px;

padding:0px;

}

#menu li{

float:left; - is very important for horizontal menu

list-style:none;

margin-right:20px;

}

#menu li a{

color:#fff;

text-decoration:none;

}









Leave a Comment