Created
September 26, 2016 20:19
-
-
Save Lego2012/d7c2b45a2cc2492db68e62523f887d4b to your computer and use it in GitHub Desktop.
Centering a DIV with unknown width
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.content { | |
margin: 0 auto 8px; | |
display: table; | |
} | |
.content div { | |
display: table-cell; | |
} | |
<!--[if IE]> | |
.content { | |
display: block; | |
text-align: center; | |
} | |
.content div { | |
display: inline; | |
zoom: 1; | |
} | |
<![endif]--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment