Created
February 1, 2012 19:58
-
-
Save anonymous/1718992 to your computer and use it in GitHub Desktop.
Untitled
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
.wrapper:hover label{ | |
background-position:left bottom; | |
} | |
label{ | |
background:url('http://img833.imageshack.us/img833/5959/stard.png') no-repeat left bottom; | |
float:right; | |
line-height:20px; | |
padding-left:20px; | |
height:15px; | |
} | |
input:checked+label,.wrapper:hover label:hover,.wrapper:hover label:hover~label{ | |
background-position:0px -1px; | |
} | |
input:checked~label{ | |
background-position:0px -1px; | |
} | |
input{ | |
display:none; | |
} | |
.wrapper{ | |
float:left; | |
} |
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="wrapper"> | |
<input type="radio" name="radiobutton" id="star-1"/><label for="star-1"></label> | |
<input type="radio" name="radiobutton" id="star-2"/><label for="star-2"></label> | |
<input type="radio" name="radiobutton" id="star-3"/><label for="star-3"></label> | |
<input type="radio" name="radiobutton" id="star-4"/><label for="star-4"></label> | |
<input type="radio" name="radiobutton" id="star-5"/><label for="star-5"></label> | |
</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","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: In order to correctly select the
star-5
radio button when you select the 5th star, you'll have to put the input elements in reverse order (this is required because the labels are right-floated).Here's a question for you: how come this breaks when you change
.wrapper
to#wrapper
in dabblet.css andclass="wrapper"
toid="wrapper"
in dabblet.html?