<div class="parent">
<div class="child"></div>
</div>
.parent {
background: #eaeaea;
width: 300px;
height: 200px;
}
.child {
background-image: url(https://d2fltix0v2e0sb.cloudfront.net/dev-rainbow.png);
background-size: 50% 50%;
background-repeat: no-repeat;
background-color: red;
width: 50%;
height: 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.