<h3>Micronesia</h3>
<div class="flag micronesia">
<div class="micronesia__grid">
<div class="micronesia__grid_row">
<div class="micronesia__star"></div>
</div>
<div class="micronesia__grid_row">
<div class="micronesia__star"></div>
<div class="micronesia__star"></div>
</div>
<div class="micronesia__grid_row">
<div class="micronesia__star"></div>
</div>
</div>
</div>
* {
box-sizing: border-box;
margin: 0;
}
body {
width: 100%;
height: 100vh;
background-color: rgb(221, 239, 255);
display: grid;
place-items: center;
font-family: cursive;
font-weight: bold;
}
h3 {
position: absolute;
text-align: center;
top: 20px;
}
/* Main Style Stars from here */
.flag {
position: relative;
width: 300px;
height: 200px;
box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
overflow: hidden;
}
.micronesia {
background-color: #75b2dd;
display: grid;
place-items: center;
}
.micronesia__grid {
width: 50%;
display: grid;
gap: 10px;
grid-template-rows: repeat(3, 1fr);
}
.micronesia__grid_row {
justify-self: center;
}
.micronesia__grid_row:nth-child(1),
.micronesia__grid_row:nth-child(3) {
rotate: -35deg;
}
.micronesia__grid_row:nth-child(2) {
display: flex;
justify-content: space-between;
gap: 70px;
}
.micronesia__grid_row:nth-child(2) > .micronesia__star:nth-child(1) {
rotate: -15deg;
}
.micronesia__grid_row:nth-child(2) > .micronesia__star:nth-child(2) {
rotate: 15deg;
}
.micronesia__star {
width: 42px;
aspect-ratio: 1;
background-color: white;
clip-path: polygon(
50% 0%,
61% 35%,
98% 35%,
68% 57%,
79% 91%,
50% 70%,
21% 91%,
32% 57%,
2% 35%,
39% 35%
);
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.