Is it possible to center an object in the middle of the screen using margin: 0 auto, but how can you center it vertically too? Additionally, is there a way to make the border in h2 surround only the text and not the whole width?
html
body {
padding: 0;
margin: 0;
}
#section1 {
background: #FEC56B;
height: 100vh;
}
#section2 {
background: #51C5D4;
height: 100vh;
}
#section3 {
background: #80D4DF;
height: 100vh;
}
#section1 h2 {
margin-top: 0px;
border: 1px solid black;
font-size: 60px;
color: white;
padding: 0px;
}
<div id="section1">
<h2>Be awesome!</h2>
</div>
<div id="section2">
</div>
<div id="section3">
</div>