<div class="card__container">
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
<div class="card"></div>
</div>
@import url("https://fonts.googleapis.com/css?family=Gochi+Hand");
@import "https://fonts.googleapis.com/css?family=Comfortaa:300,700|Bungee+Shade|Josefin+Sans:400";
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
width: 100vw;
min-height: 100vh;
margin: 0;
background-color: #291642;
font-family: "Gochi Hand", sans-serif;
font-size: 100%;
letter-spacing: 0.1rem;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
}
.card__container {
display: grid;
grid-template-columns: repeat(3, 40vmin 30vmin);
gap: 2vmin;
border: 1px dashed #f36;
counter-reset: card;
}
.card {
counter-increment: card;
display: flex;
justify-content: center;
align-items: center;
min-height: 50vmin;
background-color: #f36;
}
.card:nth-child(1) {
background-color: #f44336;
}
.card:nth-child(2) {
background-color: #2196f3;
}
.card:nth-child(3) {
background-color: #f44336;
}
.card:nth-child(4) {
background-color: #2196f3;
}
.card:nth-child(5) {
background-color: #f44336;
}
.card:nth-child(6) {
background-color: #2196f3;
}
.card::before {
content: counter(card);
font-family: "Bungee Shade", cursive;
font-size: 3.5rem;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.