Skip to content

Instantly share code, notes, and snippets.

@MurakamiShinyu
Created March 13, 2015 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MurakamiShinyu/6d9ac0ac4b9ca3797870 to your computer and use it in GitHub Desktop.
Save MurakamiShinyu/6d9ac0ac4b9ca3797870 to your computer and use it in GitHub Desktop.
Flex centering
/**
* 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;
}
<!-- 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>
// alert('Hello world!');
{"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