3 replies [Last post]
FluxNYC
Offline
newbie
Last seen: 13 years 30 weeks ago
Joined: 2007-05-07
Posts: 3
Points: 0

Hey have a div within a div its a menu but its not centering. Heres the HTML followed by the CSS. If you go to http://www.gayorbit.com/template/index2.php you'll see the menu and its aligned to the left.

CSS;
#navcontainer
{

padding: 0px;
text-align:center;
width:925px;
text-align:center;
margin: auto;
}

#navcontainer ul
{
margin: auto;
padding: 0px;
list-style-type: none;
text-align: center;
}

#navcontainer ul li { float: left; }

#navcontainer ul li a
{
text-decoration: none;
background:url(images/m3.gif) no-repeat;
font-size: 10px/12px;
float: left;
margin: 0px;
height: 44px;
width: 105px;
padding-top: 13px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
}

#navcontainer li a:hover
{
background: url(images/m3-3.gif) no-repeat left top;
color: #000000;
}
/*END*/
.links_menu {
font-family: "Tw Cen MT", "Trebuchet MS";
font-size: 14px;
color: #FFFFFF;
width: 925px;
position: relative;
margin-top: 10px;
text-align:center;
margin: auto;
}

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 37 weeks 1 day ago
Joined: 2004-06-30
Posts: 9668
Points: 801

It's because it's container

It's because it's container is too wide. Add

background: pink; overflow: auto;

to #navcontainer and you'll see what I mean.

Verschwindende wrote:
  • CSS doesn't make pies

FluxNYC
Offline
newbie
Last seen: 13 years 30 weeks ago
Joined: 2007-05-07
Posts: 3
Points: 0

Thanks. Set it to a fixed

Thanks. Set it to a fixed width and that solved it.

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 37 weeks 1 day ago
Joined: 2004-06-30
Posts: 9668
Points: 801

Thanks for coming back to us

Thanks for coming back to us Laughing out loud

Verschwindende wrote:
  • CSS doesn't make pies