I'm trying to center the text in a div. With the display: flex, everything overlaps. I want to set h1, h2, p one by one (column) but no change padding-button. Someone will help?
.wrapper{
width: 50%;
padding-bottom: 50%;
border: 1px solid black;
position: relative;
}
h1, h2, p{
position: absolute;
width: 100%;
height: 100%;
text-align: center;
display: flex;
align-items: center;
}
<body>
<div class="wrapper">
<h1>Lorem ipsum dolor sit amet consectetur adipisicing elit. Dolorum, temporibus.</h1>
<h2>Lorem ipsum dolor sit amet.</h2>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit</p>
</div>
</body>