Created
February 3, 2012 20:36
-
-
Save cahnory/1732349 to your computer and use it in GitHub Desktop.
Centrage horizontal et vertical — universel
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
/** | |
* Centrage horizontal et vertical — universel | |
*/ | |
html, body { | |
height: 100%; | |
margin: 0; | |
width: 100%; | |
} | |
.layout { | |
display: table; | |
height: 100%; | |
overflow: hidden; | |
text-align: center; | |
width: 100%; | |
*position: relative; | |
} | |
.layout-wrapper { | |
display: table-cell; | |
vertical-align: middle; | |
width: 100%; | |
*left: 0; | |
*position: absolute; | |
*top: 50%; | |
} | |
.layout-content { | |
display: -moz-inline-stack; | |
display: inline-block; | |
text-align: left; /* Retour à l'alignement classique, non nécessaire */ | |
*display: inline; | |
*left: 0; | |
*position: relative; | |
*zoom: 1; | |
*top: -50%; | |
} |
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
<div class="layout"> | |
<div class="layout-wrapper"> | |
<div class="layout-content"> | |
<div contenteditable="true"> | |
Vous êtes<br /> | |
centré ! | |
</div> | |
</div> | |
</div> | |
</div> |
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
{"view":"split","prefixfree":"1","page":"html"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment