I want to center below wrapper
inside the parent div element with a height
equal to windows
view height
, using CSS
.
HTML
<div class="main-header">
<div class="wrapper">center div</div>
</div>
CSS
.main-header{
color: #fff;
background: #16a8ec;
padding: 10px;
height: 100vh;
position: relative; }
.wrapper{
position: absolute;
left: 0px;
right: 0px;
transform: translate(0px, 50%); /* i used transform but it doesn't work */
-webkit-transform: translate(0px, 50%); /* i used transform but it doesn't work */ }
Please help me guys, thanks.