Skip to content

Instantly share code, notes, and snippets.

@morozVA
Created May 22, 2018 14:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save morozVA/3ad97742c19f96fd5760864ace0c1ff5 to your computer and use it in GitHub Desktop.
Save morozVA/3ad97742c19f96fd5760864ace0c1ff5 to your computer and use it in GitHub Desktop.
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