Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fractional star rating on css
<div class="star-ratings-sprite">
<span style="width:90%" class="star-ratings-sprite-rating"></span>
</div>
.star-ratings-sprite {
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/2605/star-rating-sprite.png") repeat-x;
font-size: 0;
height: 21px;
line-height: 0;
overflow: hidden;
text-indent: -999em;
width: 110px;
margin: 0 auto;
}
.star-ratings-sprite-rating {
background: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/2605/star-rating-sprite.png") repeat-x;
background-position: 0 100%;
float: left;
height: 21px;
display:block;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment