<h3>Algeria</h3>
<div class="flag algeria">
<div class="algeria__moon"></div>
<div class="algeria__star"></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;
}
.algeria {
background: linear-gradient(to right, #00a652 50%, #fff 0);
}
.algeria__moon {
position: absolute;
inset: 0;
margin: auto;
transform: rotate(40deg) translate(8px, -8px);
height: 80px;
width: 80px;
box-shadow: -8px 8px 0 8px #ed1b24;
border-radius: 50%;
}
.algeria__star {
position: absolute;
margin: auto;
inset: 0;
transform: rotate(20deg) translate(20px, -10px);
width: 50px;
height: 50px;
background-color: #ed1b24;
clip-path: polygon(
50% 0%,
61% 35%,
98% 35%,
68% 57%,
79% 91%,
50% 70%,
21% 91%,
32% 57%,
2% 35%,
39% 35%
);
}
.algeria__logo {
position: absolute;
inset: 0;
width: 140px;
margin: auto;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.