Amazing Star Rating Design In HTML and CSS | Frontend everything
Hello Everyone 👋Welcome to My New Blog. Today I have made a Star Rating with the help of HTML and CSS😍
I am Piyush, Sharing About Web development Daily. You can also check out me at @frontendeverything.
Let's start making this star rating step by step.
Before starting the blog, you might think about where you can use this project in real-life-based projects. So it's a UI of star rating and you can use it in the website's feedback section to a customer who can rate your product/service or website.
Let's start making this star rating step by step.
Video of the project,
So that was the preview now let us start making the project 😄 First, we will code HTML then CSS, and also I have shared codepen ink to make it easier for you.
HTML 🎈( step - 1)
In HTML we have made a div for the container for the star rating and used input fields for star buttons.
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css">
</head>
<body>
<div class="rating-css">
<div>star rating system<br>using html & css</div>
<div class="star-icon">
<input type="radio" name="rating1" id="rating1">
<label for="rating1" class="fa fa-star"></label>
<input type="radio" name="rating1" id="rating2">
<label for="rating2" class="fa fa-star"></label>
<input type="radio" name="rating1" id="rating3">
<label for="rating3" class="fa fa-star"></label>
<input type="radio" name="rating1" id="rating4">
<label for="rating4" class="fa fa-star"></label>
<input type="radio" name="rating1" id="rating5">
<label for="rating5" class="fa fa-star"></label>
</div>
</div>
<!--This is my youtube channel link-->
<a href="https://youtu.be/lW8-w66v9CQ" target="_blank"><i style="margin-right: 5px" class="fab fa-youtube"></i>Tutorial</a>
</body>
</html>
After the HTML we will design the container and stars and will make an amazing design.
CSS🎈( step - 2)
* {
margin: 0;
padding: 0;
}
body {
display: flex;
min-height: 100vh;
align-items: center;
justify-content: center;
background: #ffe400;
}
.rating-css {
height: 250px;
width: 400px;
background: #101012;
border: 4px solid #838383;
padding: 20px;
}
.rating-css div {
color: #ffe400;
font-size: 30px;
font-family: sans-serif;
font-weight: 800;
text-align: center;
text-transform: uppercase;
padding: 20px 0;
}
.rating-css input {
display: none;
}
.rating-css input + label {
font-size: 60px;
text-shadow: 1px 1px 0 #ffe400;
cursor: pointer;
}
.rating-css input:checked + label ~ label {
color: #838383;
}
.rating-css label:active {
transform: scale(0.8);
transition: 0.3s ease;
}
/*This is my youtube channel link*/
a {
position: absolute;
bottom: 20px;
font-weight: 600;
text-decoration: none;
font-size: 20px;
font-family: sans-serif;
right: 20px;
color: #000;
}
a:hover {
color: red;
}
Now we have done the CSS coding as well, now we will see the final output and also check the codepen link mentioned below.
Final Output
The codepen link is here for making your work easier!
.
.
.
.
.
.
Thank You For Scrolling Till here 😊. If You gain any knowledge then do checkout me at @frontendeverything. I am Piyush 🎉 I provide Content related to programming, technology, web development Daily.
.
