Created
March 4, 2015 14:59
-
-
Save NetanelBasal/41d879b16f788fd32863 to your computer and use it in GitHub Desktop.
Radio button
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
label { | |
display: inline-block; | |
cursor: pointer; | |
position: relative; | |
padding-left: 23px; | |
font-size: 15px; | |
} | |
input[type=radio] { | |
display: none; | |
} | |
label:before { | |
content: ""; | |
display: inline-block; | |
width: 16px; | |
height: 16px; | |
margin-right: 10px; | |
position: absolute; | |
left: 0; | |
bottom: 1px; | |
background-color: #fff; | |
border-radius:50%; | |
box-shadow: inset 0 2px 5px rgba(0,0,0,.2); | |
} | |
input[type=radio]:checked + label:before { | |
content: "\2022"; | |
color: #ff6700; | |
font-size: 30px; | |
text-align: center; | |
line-height: 21px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="radio"> | |
<input id="male" type="radio" name="gender" value="male"> | |
<label for="male">Male</label> | |
</div> | |
<script id="jsbin-source-css" type="text/css"> | |
label { | |
display: inline-block; | |
cursor: pointer; | |
position: relative; | |
padding-left: 23px; | |
font-size: 15px; | |
} | |
input[type=radio] { | |
display: none; | |
} | |
label:before { | |
content: ""; | |
display: inline-block; | |
width: 16px; | |
height: 16px; | |
margin-right: 10px; | |
position: absolute; | |
left: 0; | |
bottom: 1px; | |
background-color: #fff; | |
border-radius:50%; | |
box-shadow: inset 0 2px 5px rgba(0,0,0,.2); | |
} | |
input[type=radio]:checked + label:before { | |
content: "\2022"; | |
color: #ff6700; | |
font-size: 30px; | |
text-align: center; | |
line-height: 21px; | |
} </script> | |
</body> | |
</html> |
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
label { | |
display: inline-block; | |
cursor: pointer; | |
position: relative; | |
padding-left: 23px; | |
font-size: 15px; | |
} | |
input[type=radio] { | |
display: none; | |
} | |
label:before { | |
content: ""; | |
display: inline-block; | |
width: 16px; | |
height: 16px; | |
margin-right: 10px; | |
position: absolute; | |
left: 0; | |
bottom: 1px; | |
background-color: #fff; | |
border-radius:50%; | |
box-shadow: inset 0 2px 5px rgba(0,0,0,.2); | |
} | |
input[type=radio]:checked + label:before { | |
content: "\2022"; | |
color: #ff6700; | |
font-size: 30px; | |
text-align: center; | |
line-height: 21px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment