<div class="container">
<div class="item">Centered Item</div>
</div>
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #f0f0f0;
}
.item {
padding: 20px;
background: #007bff;
color: #fff;
border-radius: 5px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.