theflyingminst
01-07-2009, 09:21 AM
Hi all, I downloaded a template from here (http://freecssxhtmltemplates.com/freecarandautomotive****************.php).
It defaults to having everything on the left side of the page.. What I want to do is center everything. I managed to do that for all of the divs with margin: 0 auto but I can't get the topmenu to center. Here's the code. Thanks so much.
<div id="topmenu">
<a name="search_box"></a>
<ul>
<li><a href="index.asp">Home</a></li>
<li><a href="search_cars.asp">Inventory</a></li>
<li><a href="#">Specials</a></li>
<li><a href="financing.asp">Financing</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div><!-- end id top menu -->
#topmenu
{
margin: 0 auto 0 auto;
height: 30px;
position: relative;
overflow: hidden;
background: #000;
padding-top: 8px;
}
#topmenu ul
{
height: auto;
position: relative;
overflow: hidden;
}
#topmenu ul li
{
margin: 0 auto 0 auto;
padding: 0;
list-style-type: none;
display: inline;
line-height: 1.2em;
}
#topmenu ul li a
{
margin: 0 auto 0 auto;
padding: 0 10px 0 20px;
position: relative;
color: #fff;
text-decoration: none;
font-size: 1em;
font-weight: bold;
}
#topmenu ul li a:hover
{
background: url("images/image2.jpg") left center no-repeat;
}
It defaults to having everything on the left side of the page.. What I want to do is center everything. I managed to do that for all of the divs with margin: 0 auto but I can't get the topmenu to center. Here's the code. Thanks so much.
<div id="topmenu">
<a name="search_box"></a>
<ul>
<li><a href="index.asp">Home</a></li>
<li><a href="search_cars.asp">Inventory</a></li>
<li><a href="#">Specials</a></li>
<li><a href="financing.asp">Financing</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div><!-- end id top menu -->
#topmenu
{
margin: 0 auto 0 auto;
height: 30px;
position: relative;
overflow: hidden;
background: #000;
padding-top: 8px;
}
#topmenu ul
{
height: auto;
position: relative;
overflow: hidden;
}
#topmenu ul li
{
margin: 0 auto 0 auto;
padding: 0;
list-style-type: none;
display: inline;
line-height: 1.2em;
}
#topmenu ul li a
{
margin: 0 auto 0 auto;
padding: 0 10px 0 20px;
position: relative;
color: #fff;
text-decoration: none;
font-size: 1em;
font-weight: bold;
}
#topmenu ul li a:hover
{
background: url("images/image2.jpg") left center no-repeat;
}