<h3>South Africa</h3>
<div class="flag south_africa">
<div class="south_africa__bottom_bg_shape"></div>
<div class="south_africa__bottom_shape"></div>
<div class="south_africa__top_bg_shape"></div>
<div class="south_africa__top_shape"></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;
}
.south_africa {
background: #007847;
}
/* Black and Yellow Triangle */
.south_africa::before,
.south_africa::after {
position: absolute;
content: "";
top: 12%;
border: 75px solid transparent;
border-left: 112px solid #ffb915;
}
/* Black Triangle */
.south_africa::after {
top: 20%;
border-width: 60px 90px;
border-left-color: black;
}
.south_africa__bottom_bg_shape,
.south_africa__bottom_shape,
.south_africa__top_bg_shape,
.south_africa__top_shape {
position: absolute;
right: -1px;
bottom: 0;
width: 240px;
height: 64px;
scale: 1.2;
background-color: white;
clip-path: polygon(40% 0, 100% 0, 100% 100%, 0 100%);
}
/* Top Red Shape */
.south_africa__top_bg_shape,
.south_africa__top_shape {
transform: scaley(-1);
top: 0;
}
.south_africa__top_shape {
scale: 1;
background-color: #e1392d;
}
/* bottom blue Shape */
.south_africa__bottom_shape {
scale: 1;
background-color: #000c8a;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.