TheFreak Posted March 22, 2009 Share Posted March 22, 2009 I am trying to shift my "maincont" and everything in the center,but for some reason it wont,even if i used align.Heres my code. HTML: <body> <div align="center" class="maincont"> <div id="menucontainer" > <div id="menunav" > <ul> <li><a href="" title="css website navigation menus" class="current"><span>Movies</span></a></li> <li><a href="" title="css website navigation menus"><span>Television</span></a></li> <li><a href="" title="css website navigation menus"><span>Documentries</span></a></li> <li><a href="" title="css website navigation menus"><span>Plays</span></a></li> <li><a href="" title="css website navigation menus"><span>Kids</span></a></li> <li><a href="" title="css website navigation menus"><span>Videos</span></a></li> <li><a href="" title="css website navigation menus"><span>Stores</span></a></li> </ul> </div> </div> </div> </body> CSS: *{ list-style:none; } #menucontainer{ position:relative; height:50px; color:#FFFFFF; background:#383636; width:100%; font-family:Helvetica,Arial,Verdana,sans-serif; } #menunav{ position:relative; height:38px; font-size:12px; text-transform:uppercase; font-weight:bold; background:#fff url(images/background.jpg) repeat-x bottom left; padding:0 0 0 20px;} #menunav ul{ margin:0; padding:0; list-style-type:none; width:auto; float:left;} #menunav ul li{ display:block; float:left; margin:0 1px;} #menunav ul li a{ display:block; float:left; color:#EAF3F8; text-decoration:none; padding:0 0 0 20px; height:38px;} #menunav ul li a span{ padding:12px 20px 0 0; height:21px; float:left;} #menunav ul li a:hover{ color:#fff; background:transparent url(images/hover.jpg) repeat-x bottom left;} #menunav ul li a:hover span{ display:block; width:auto; cursor:pointer;} #menunav ul li a.current, #menunav ul li a.current:hover{ color:#fff; background:#1D6893 url(images/left.jpg) no-repeat top left; line-height:275%;} #menunav ul li a.current span{ display:block; padding:0 20px 0 0; width:auto; background:#383636 url(images/right.jpg) no-repeat top right; height:38px;} .maincont { border-style: solid; align:center; border-width: 1px; width: 900px; height: 900px } Quote Link to comment Share on other sites More sharing options...
dbrimlow Posted March 22, 2009 Share Posted March 22, 2009 There is no such thing as "align:center", for text you can use "text-align:center". For boxes you need to first designate a width (in px or %), then use "margin: 0 auto" to have it auto center. Quote Link to comment Share on other sites More sharing options...
TheFreak Posted March 22, 2009 Author Share Posted March 22, 2009 Thankyou,was grilling over it a lot Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.