Jump to content

Can't Center Content


cclloyd9785

Recommended Posts

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 by cclloyd
Link to comment
Share on other sites

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

  • 11 months later...
  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...