WEBLEB
Home
Editor
Login
Pro
English
English
Français
Español
Português
Deutsch
Italiano
हिंदी
CSS 5 Star Rating
5496
code_rating
Publish Your Code
Recommended
21 July 2025
UNO Card HTML CSS Example
28 July 2023
CSS Search Bar
19 March 2025
Pure CSS3 Star Wars Lightsaber Checkboxes
index.html
Copy
Webleb
styles.css
Copy
body { background: #e2e1d9; height: 100vh; display: flex; align-items: center; justify-content: center; overflow-y: hidden; } .rating { display: inline-block; font-size: 0; position: relative; text-transform: capitalize; padding: 0 50px 8%; color: gray; } .rating label { display: inline-block; float: right; padding: 0; font-size: 50px; cursor: pointer; } .rating label::before { content: "\2606"; display: inline-block; transition: 0.2s; } .rating label span { opacity: 0; position: absolute; left: 0; bottom: 0; width: 100%; text-align: center; height: 20px; font-size: 1rem; white-space: nowrap; transition: 0.15s ease-out; pointer-events: none; letter-spacing: -2px; transform: translateY(-50%); } .rating label:hover span { opacity: 1; transform: none; letter-spacing: 0; } .rating label:hover::before { color: orange; opacity: 0.6; filter: drop-shadow(0 0 4px); } .rating label:hover ~ *::before { color: orange; opacity: 0.6; filter: drop-shadow(0 0 4px); } .rating input:checked ~ label::before { content: "\2605"; color: orange; filter: drop-shadow(0 0 4px); transform: rotate(0.2turn); transition-delay: calc(0.1 * attr(data-idx integer)); }
main.js
Copy
// Nothing to copy