cclloyd9785 Posted September 25, 2011 Share Posted September 25, 2011 (edited) No matter what I try, I can't get the tabs, or tab content to center on the page. Page in question: http://cclloyd.zxq.net/inventory.htmlCode in question <div style="text-align:center"> <div id="tabs" style="text-align:center; clear:both; margin-bottom:5px; margin-right:600px;"> <ul> <li><a href="#tab-1">Rules</a></li> <li><a href="#tab-2">Summons</a></li> </ul> <div id="tab-1"> <h3> </h3> <span class="th border" style="display:inline-block; width:500px; min-height:100px; text-align:left; padding:3px;"> • I have the right to reject any offer<br> • You make the offer, not me. I am willing to barter, but you have to make the starting offer.<br> • No refunds once a trade is completed.<br> • If a trade will take multiple trades, you MUST stay online for all trades until they are finished </span> </div> <div id="tab-2" style="text-align:center"> <h3> </h3> <table class="tbor" style="width:600px"> <tr> <td class="th center" rowspan="3">Summons</td> <td class="th center">Item</td> <td class="th center">Name</td> <td class="th center">Qty</td> <td class="th center">Looking For</td></tr><tr> <td><img src="http://static.pokefarm.org/_img/items/slateofrock.png" /></td> <td><span>Slate of Rock</span></td> <td><span>2</span></td> <td class="left" rowspan="2"> <span class="left"> <p style="margin-left:10px;">•Only trading for other summons<br> •Fire fang is instant trade</p> </span> </td><tr> <td><img src="http://static.pokefarm.org/_img/items/slateofsteel.png" /></td> <td><span class="dark">Slate of Steel</span></td> <td><span class="dark">2</span></td></tr></table></div> </div> </div></div> CSS associated with it: http://cclloyd.zxq.net/tabs.css Edited September 25, 2011 by cclloyd Link to comment Share on other sites More sharing options...
Ingolme Posted September 25, 2011 Share Posted September 25, 2011 If an element is floated to the left you can't expect it to be in the center. First, remove all the style attributes and move the CSS to the stylesheet. The margin-right: 600px rule is actually messing things up. To center a block element, give it a specific width and then set the margin to "auto" Link to comment Share on other sites More sharing options...
worrall Posted September 5, 2012 Share Posted September 5, 2012 If you want your code to be in the center of the page, then just mention in the starting of the code as align "center" , if the code is even moving to the left then use the <center> tag. Link to comment Share on other sites More sharing options...
Ingolme Posted September 5, 2012 Share Posted September 5, 2012 The <center> tag and the align attribute are deprecated and, once again, you're replying to a really old thread. Link to comment Share on other sites More sharing options...
klmuralimohan Posted September 14, 2012 Share Posted September 14, 2012 Simple Answser: Wherever you want the text in center, to that give the width and text align center for the div and remove float value. It will work find. Ex: .classname {width:200px;text-align:center;} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now