<div class="parent">
<div class="child"></div>
</div>
.parent {
background: #eaeaea;
width: 300px;
height: 200px;
}
.child {
background: red;
width: 100px;
height: 50px;
transform: translate(50%, 50%);
}
// GRID OVERLAY
.parent {
position: relative;
}
.parent::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 99;
background: radial-gradient(circle at 1px 1px,#000 2px,transparent 0);
background-size: 49.5px 49.5px;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.