I have one <h1>
element and three divs with 33% width. All those 4 elements are in a container with height set to 100vh.
At the moment I can align horizontally the three divs but when I insert the <h1>
tag it aligns next to them.
How can I align the <h1>
on top and the three elements below it just in the center of the page?
.outside {
background-color: red;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.inside {
background-color: yellow;
width: 30%;
margin-left: 1.5%;
margin-right: 1.5%;
float: left;
}
<div class="outside">
<div>
<h1> This is another</h1>
</div>
<div class="inside">
<h1>This is h1 tag</h1>
<p>This is paragraph</p>
</div>
<div class="inside">
<h1>This is h1 tag</h1>
<p>This is paragraph</p>
</div>
<div class="inside">
<h1>This is h1 tag</h1>
<p>This is paragraph</p>
</div>
</div>