Skip to content

Instantly share code, notes, and snippets.

@Gerst20051
Created November 29, 2013 03:37
Show Gist options
  • Save Gerst20051/7701271 to your computer and use it in GitHub Desktop.
Save Gerst20051/7701271 to your computer and use it in GitHub Desktop.
Ratings Stars
/*
Ratings Stars
(with as little code as possible)
- Modified by @mprogano -
*/
.rating {
unicode-bidi: bidi-override;
direction: rtl;
text-align: center;
}
.rating > span {
display: inline-block;
position: relative;
overflow: hidden;
width: 1em;
font-size:1.5em; /* Bigger Middots - @mprogano */
}
.rating > span:hover {
text-indent: 9999px;
}
.rating > span:hover:before,
.rating > span:hover ~ span:before {
content: "\2605";
position: absolute;
top: -2px; /* V.Align Center - @mprogano */
left: 0;
font-size:0.90em; /* Smaller Stars - @mprogano */
}
body { padding: 100px; }
<div class="rating">
<span>&#149;</span><span>&#149;</span><span>&#149;</span><span>&#149;</span><span>&#149;</span>
<!-- /* Changes the Empty Stars to Middots (#149; is most crossbrowser) - @mprogano */ -->
</div>
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment