Skip to content

Instantly share code, notes, and snippets.

@NetanelBasal
Created March 4, 2015 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NetanelBasal/41d879b16f788fd32863 to your computer and use it in GitHub Desktop.
Save NetanelBasal/41d879b16f788fd32863 to your computer and use it in GitHub Desktop.
Radio button
<!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>
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