<div class="container">
<div class="item">1</div>
<div class="item">2</div>
<div class="item">3</div>
<div class="item">4</div>
<div class="item">5</div>
<div class="item">6</div>
</div>
// Init~ Don't touch here!
$color: #555;
body {
padding: 80px;
font-family: 'NanumSquareRound',sans-serif;
color: $color;
}
.container {
// width: 380px;
// height: 250px;
border: 10px solid rgba(black, .1);
border-radius: 10px;
display: grid;
}
.item {
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
box-sizing: border-box;
position: relative;
font-size: 20px;
color: $color;
font-weight: 900;
text-shadow: 3px 0 0 rgba(white, .5);
&::before {
content: "";
position: absolute;
top: 5px;
left: 5px;
border: 4px solid $color;
border-radius: 10px;
box-sizing: border-box;
width: calc(100% - 10px);
height: calc(100% - 10px);
z-index: -1;
}
$colors: (tomato, orange, limegreen, dodgerblue, hotpink, darkgray, crimson, orangered, lawngreen, aqua, royalblue, wheat, brown, gray, salmon, deeppink, gold, springgreen, slateblue, darkslategray);
@each $color in $colors {
$index: index($colors, $color);
&:nth-child(#{$index})::before {
background-color: rgba($color, .8);
}
}
&::after {
content: "";
width: 10px;
height: 50%;
background: white;
position: absolute;
top: 16px;
left: 16px;
border-radius: 100px;
opacity: .3;
z-index: -1;
}
}
// Test here!
.container {
width: 400px;
display: grid;
grid-template-rows: repeat(2, 100px);
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: 100px;
}
.item:nth-child(1) {
grid-column: 1 / 4;
}
.item:nth-child(3) {
grid-column: span 2;
}
View Compiled
This Pen doesn't use any external JavaScript resources.