Created
March 13, 2015 10:51
-
-
Save MurakamiShinyu/6d9ac0ac4b9ca3797870 to your computer and use it in GitHub Desktop.
Flex centering
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
/** | |
* Flex centering | |
*/ | |
body { | |
display: flex; | |
border: outset blue; | |
margin: 0; | |
text-align: center; | |
height: 100vh; | |
box-sizing: border-box; | |
} | |
main { | |
border: outset lime; | |
margin: auto; | |
} |
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 to be placed inside <body>…</body> --> | |
<body> | |
<main> | |
<h1>Hello world!</h1> | |
<section> | |
<h2>First Section</h2> | |
<p>This is the first paragraph of this document.</p> | |
</section> | |
</main> | |
</body> |
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
// alert('Hello world!'); |
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","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment