Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Ratings Stars
Ratings Stars
(with as little code as possible)
.rating {
unicode-bidi: bidi-override;
direction: rtl;
text-align: center;
.rating > span {
display: inline-block;
position: relative;
width: 1.1em;
.rating > span:hover,
.rating > span:hover ~ span {
color: transparent;
.rating > span:hover:before,
.rating > span:hover ~ span:before {
content: "\2605";
position: absolute;
left: 0;
color: gold;
body { padding: 100px; }
<div class="rating">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.