Skip to content

Instantly share code, notes, and snippets.

@markthepixel
Forked from anonymous/dabblet.css
Created January 31, 2012 18:44
Show Gist options
  • Save markthepixel/1712132 to your computer and use it in GitHub Desktop.
Save markthepixel/1712132 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","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment