开发者

having trouble centering table in Chrome and Safari

开发者 https://www.devze.com 2023-03-07 16:38 出处:网络
I am not sure what I am doing wrong. I cannot seem to center table with two im开发者_开发技巧ages between 2in side the right . Works in firefox, opera, ie8. XHTML and CSS validates.A few notes on cent

I am not sure what I am doing wrong. I cannot seem to center table with two im开发者_开发技巧ages between 2 in side the right . Works in firefox, opera, ie8. XHTML and CSS validates.


A few notes on centering.

  1. Always provide a width to the object you are trying to center
  2. Once a width is set then use margin:0 auto; on that element
  3. Enjoy seeing your code centered...
  4. Also, if your element is inline (anchor, span, etc) make sure you display the element as display:block;

If you show some code I'm sure it's a simple fix.


Try setting the width and margin explicitly to add to 100%: width:90%;margin-left:5%;margin-right:5%;

0

精彩评论

暂无评论...
验证码 换一张
取 消