<div class="container">
<div class="item"></div>
</div>
.container{
position: relative;
width: 90vw;
height: 90vh;
border: 3px solid black;
margin: auto;
}
.item {
position: absolute;
top: 0; bottom: 0;
left: 10vw;
right: 10vw;
margin: auto;
background: teal;
height: 50vh;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.