Created
November 19, 2017 20:41
-
-
Save ameyms/4d9dd2b2acc7d74d91ec1697272a67c9 to your computer and use it in GitHub Desktop.
Ratings Stars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Ratings Stars | |
(with as little code as possible) | |
*/ | |
.rating { | |
unicode-bidi: bidi-override; | |
direction: rtl; | |
text-align: center; | |
} | |
.rating > span { | |
display: inline-block; | |
position: relative; | |
width: 1.1em; | |
} | |
.rating > span:hover, | |
.rating > span:hover ~ span { | |
color: transparent; | |
} | |
.rating > span:hover:before, | |
.rating > span:hover ~ span:before { | |
content: "\2605"; | |
position: absolute; | |
left: 0; | |
color: gold; | |
} | |
body { padding: 100px; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="rating"> | |
<span>☆1</span><span>☆</span><span>☆</span><span>☆</span><span>☆</span> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment