Skip to content

Instantly share code, notes, and snippets.

@shaneog
Forked from kcarnold/rating.html
Created July 12, 2014 00:21
Show Gist options
  • Save shaneog/28c7995dce4e9d34e880 to your computer and use it in GitHub Desktop.
Save shaneog/28c7995dce4e9d34e880 to your computer and use it in GitHub Desktop.
<span class="rating">
<input id="star-5" name="radioradio" type="radio" value="5"><label for="star-5"></label>
<input id="star-4" name="radioradio" type="radio" value="4"><label for="star-4"></label>
<input id="star-3" name="radioradio" type="radio" value="3"><label for="star-3"></label>
<input id="star-2" name="radioradio" type="radio" value="2"><label for="star-2"></label>
<input id="star-1" name="radioradio" type="radio" value="1"><label for="star-1"></label>
</span>
.rating {
font-family: FontAwesome;
display: inline-block;
}
.rating input {
display: none;
}
.rating label {
float: right;
padding-left: 2px;
font-size: 120%;
}
.rating label:before {
content: "";
}
.rating input:checked+label:before,
input:checked~label:before,
.rating:hover label:hover:before,
.rating:hover label:hover~label:before {
content: "";
color: #E3CF7A;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment