Centering a DIV of Unknown Width


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.