Created
February 3, 2012 19:30
-
-
Save cahnory/1731918 to your computer and use it in GitHub Desktop.
Centrage horizontal et vertical — navigateurs modernes
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 — navigateurs modernes | |
*/ | |
html, body { | |
height: 100%; | |
margin: 0; | |
width: 100%; | |
} | |
.layout { | |
display: table; | |
height: 100%; | |
overflow: hidden; | |
text-align: center; | |
width: 100%; | |
} | |
.layout-wrapper { | |
display: table-cell; | |
vertical-align: middle; | |
width: 100%; | |
} | |
.layout-content { | |
display: inline-block; | |
text-align: left; /* Retour à l'alignement classique, non nécessaire */ | |
} |
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"> | |
Vous êtes<br /> | |
centré ! | |
</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":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment