Fixed top menu in CSS

Many time we require a menu that is fixed at top of the website, so here is the tutorial of Fixed top menu in CSS. Use this simple CSS code to add this menu to your website.

CSS

body
{
 margin:0px;
 padding:0px;
}
#top-menu
{
 width:100%;
 height:50px;
 background:#0C9;
 position:fixed;
}
#top-menu ul
{
 margin:0px;
 padding:0px;
 display:table;
 list-style:none;
 width:100%;
}
#top-menu ul li
{
 display:table-cell;
 text-align:center;
}
#top-menu ul li a
{
 display:block;
 height:50px;
 line-height:50px;
 text-decoration:none;
 color:#000;
 text-transform:uppercase;
}

HTML


Download File Used in this example View Live Demo

No comments:

Post a Comment