/* remove the list style */ #nav { margin:0; padding:0; list-style:none; } /* make the LI display inline */ /* it's position relative so that position absolute can be used in submenu */ #nav li { float:right; display:table-cell; width:78px; position:relative; z-index:500; margin:0 0; background:url('template/underline.gif') no-repeat bottom center; } #nav li:hover{background:url('template/underline-red.gif') no-repeat bottom center;} /* this is the parent menu */ #nav li a { display:table-cell; padding:0 0 0 0; font-family:tahoma; font-size:8pt; height:25px; line-height:25px; text-decoration:none; text-align:center; color:#000000; } #nav li a:hover { color:#ff0000; background:url('template/underline-red.gif') no-repeat bottom center; } /* you can make a different style for default selected value */ #nav a.selected { color:#ff0000; } /* submenu, it's hidden by default */ #nav ul { position:absolute; left:-117; display:none; margin:0 0 0 0; padding:0; list-style:none; } #nav ul li { width:312px; float:left; display:table-cell; text-align:center; height:25px; } /* display block will make the link fill the whole area of LI */ #nav ul a { display:table-cell; height:25 px; line-height:25 px; padding:0 0; color:#000000; font-size:8pt; background:url('template/underline.gif') bottom; } #nav ul a:hover { text-decoration:none; color:#ff0000; background:url('template/underline-red.gif') bottom; } /* fix ie6 small issue */ /* we should always avoid using hack like this */ /* should put it into separate file : ) */ *html #nav ul { margin:0 0 0 -2px; }