PDA

View Full Version : Can someone help me center this horizontal menu


TrackNField
06-19-2009, 02:09 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>123</title>
<link href="oto.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
* {
margin : 0;
padding : 0;
}
html, body, #wrap {
height : 100%;
margin : 0 auto;
width : 980px;
background-color : #666666;
}
body > #wrap {
height : auto;
min-height : 100%;
width : 980px;
background-color : #333333;
}
a img {
border : none;
}
#main {
height : 200px;
background-color : #999999;
}
#nav {
height : 35px;
}
#sad {
padding-bottom : 200px;
background-color : #999999;
height : 500px;
}
#footer {
position : relative;
margin-top : -200px;
height : 200px;
clear : both;
background-color : #000000;
}
.clearfix:after {
content : ".";
display : block;
height : 0;
clear : both;
visibility : hidden;
}
.clearfix {
display : inline-block;
}
* html .clearfix {
height : 1%;
}
.clearfix {
display : block;
}
.menu {
border : none;
border : 0;
margin : 0;
padding : 0;
font : 67.5% "Lucida Sans Unicode", "Bitstream Vera Sans", "Trebuchet Unicode MS", "Lucida Grande", Verdana, Helvetica, sans-serif;
font-size : 14px;
font-weight : bold;
margin-left: auto;
margin-right: auto;
}
.menu ul {
background : #333333;
height : 35px;
list-style : none;
padding : 0;
}
.menu li {
float : left;
padding : 0;
}
.menu li a {
background : #333333 url("images/seperator.gif") no-repeat bottom right;
color : #cccccc;
display : block;
font-weight : normal;
line-height : 35px;
margin : 0;
padding : 0 25px;
text-align : center;
text-decoration : none;
}
.menu li a:hover, .menu ul li:hover a {
background : #2580a2 url("images/hover.gif") no-repeat bottom center;
color : #ffffff;
text-decoration : none;
}
.menu li ul {
background : #333333;
display : none;
height : auto;
padding : 0;
margin : 0;
border : 0;
position : absolute;
width : 250px;
z-index : 200;
}
.menu li:hover ul {
display : block;
}
.menu li li {
background : url('images/sub_sep.gif') no-repeat bottom left;
display : block;
float : none;
margin : 0;
padding : 0;
width : 250px;
}
.menu li:hover li a {
background : none;
}
.menu li ul a {
display : block;
height : 35px;
font-size : 12px;
font-style : normal;
margin : 0;
padding : 0 10px 0 15px;
text-align : left;
}
.menu li ul a:hover, .menu li ul li:hover a {
background : #2580a2 url('images/hover_sub.gif') no-repeat center left;
border : 0;
color : #ffffff;
text-decoration : none;
}
.menu p {
clear : left;
}
-->
</style></head>

<body>
<div id="wrap">
<div id="main" class="clearfix">header</div>
<div id="nav">

<div class="menu">
<ul>
<li><a href="#" ><img src="images/bth.png" alt="Oto Nautika"></a></li>
<li><a href="#">Aaaaaa</a>
<ul>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
</ul>
</li>
<li><a href="/faq.php">Bbbbbbb</a>
<ul>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
</ul>
</li>
<li><a href="/faq.php">Cccccccccc</a>
<ul>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
</ul>
</li>
<li><a href="/faq.php">Ddddddd</a>
<ul>
<li><a href="#">1</a></li>
</ul>
</li>
<li><a href="/faq.php">Eeeeeee</a>
<ul>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
</ul>
</li>
<li><a href="/faq.php">Ffffff</a>
<ul>
<li><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">5</a></li>
<li><a href="#">6</a></li>
</ul>
</li>
</ul>
</div>

</div>
<div id="sad">content</div>
<div id="footer">footer</div>
</div>
</body>
</html>


That's the page. And I just can't get the menu in the center of NAV div.

Here's the preview
http://www.webdevout.net/test?0L

Anyone has any suggestions?

psywalker
06-20-2009, 03:28 AM
.menu ul {
background : #333333;
height : 35px;
list-style : none;
padding : 0;
padding-left: 7em;
}

TrackNField
06-20-2009, 10:06 AM
much appreciated!