How To Create Indian Flag 🤩 using HTML and CSS with VS Code
How To Create Indian Flag 🤩 using HTML and CSS with VS Code
#Coding is Fun
HTML & CSS code : -
<!-- Indian Flag.html File -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<!-- Stylesheet -->
<link rel="stylesheet" type="text/css" href="Flag Design.css">
</head>
<body>
<center>
<div id="saffron"></div>
<div class="chakra">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</div>
<div id="green"></div>
</center>
</body>
</html>
/* ---------------------------------------------------------------- */
/* Flag Design.css File */
#saffron{
border: 1px solid #FF9933;
height: 100px;
width: 600px;
background-color: #FF9933;
padding: 20px;
}
/* For circle */
.chakra{
width: 100px;
height: 100px;
border:2px solid #000080;
border-radius: 50%;
margin: auto;
}
/* For spokes */
.chakra li{
list-style: none;
width: 98px;
border: 1px solid #000080;
position: relative;
}
/* horizontal line through centre */
li:nth-child(1){
top: 49px;
}
/* vertical line through centre */
li:nth-child(2){
top: 47px;
transform: rotate(90deg);
}
/* 15 deg right turn of nth-child(1) through centre */
li:nth-child(3){
top: 45px;
transform: rotate(15deg);
}
li:nth-child(4){
top: 43px;
transform: rotate(30deg);
}
li:nth-child(5){
top: 41px;
transform: rotate(45deg);
}
li:nth-child(6){
top: 39px;
transform: rotate(60deg);
}
li:nth-child(7){
top: 37px;
transform: rotate(75deg);
}
li:nth-child(8){
top: 35px;
transform: rotate(105deg);
}
li:nth-child(9){
top: 33px;
transform: rotate(120deg);
}
li:nth-child(10){
top: 31px;
transform: rotate(135deg);
}
li:nth-child(11){
top: 29px;
transform: rotate(150deg);
}
li:nth-child(12){
top: 27px;
transform: rotate(165deg);
}
#green{
border: 1px solid #138808;
height: 100px;
width: 600px;
background-color: #138808;
padding: 20px;
}

Comments
Post a Comment