<h3>Zimbabwe</h3>
<div class="flag zimbabwe">
<img src="https://imgur.com/whSeEZu.png" height="60" alt="Zimbabwe" />
</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;
}
.zimbabwe {
background: linear-gradient(
#006400 14.28%,
#ffd200 14.28%,
#ffd200 28.56%,
#d40000 28.56%,
#d40000 42.84%,
#000 42.84%,
#000 57.12%,
#d40000 57.12%,
#d40000 71.4%,
#ffd200 71.4%,
#ffd200 85.68%,
#006400 0
);
}
.zimbabwe::before,
.zimbabwe::after {
position: absolute;
content: "";
border: 100px solid transparent;
border-left-color: black;
left: 7px;
box-shadow: -10px 0 black; /* After pusing a little bit left then it had a small gap in the bottom and top left corner "remove to see the difference"*/
}
.zimbabwe::after {
left: 0;
border-left-color: white;
}
.zimbabwe > img {
position: absolute;
left: 5px;
top: 64px;
z-index: 1;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.