Posted By

alp on 02/14/11


Tagged

centering unknown-width


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

wildrocker92
saman
stonetatara


Centering a DIV of Unknown Width


 / Published in: CSS
 

  1. .content {
  2. margin: 0 auto 8px;
  3. display: table;
  4. }
  5. .content div {
  6. display: table-cell;
  7. }
  8. <!--[if IE]>
  9. .content {
  10. display: block;
  11. text-align: center;
  12. }
  13. .content div {
  14. display: inline;
  15. zoom: 1;
  16. }
  17. <![endif]-->

Report this snippet  

You need to login to post a comment.