Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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> -->
<h1>Hello world!</h1>
<h2>First Section</h2>
<p>This is the first paragraph of this document.</p>
// alert('Hello world!');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment