Skip to content

Instantly share code, notes, and snippets.

@alexmoise
Last active November 20, 2017 14:49
Show Gist options
  • Save alexmoise/43948fe9d8dca3e8154ade8a51a37d0a to your computer and use it in GitHub Desktop.
Save alexmoise/43948fe9d8dca3e8154ade8a51a37d0a to your computer and use it in GitHub Desktop.
Radio buttons quick CSS styling in black and red
/* RADIO BUTTONS STYLYNG */
input[type='radio'] {
-webkit-appearance:none;
width:18px;
height:18px;
border:2px solid black;
border-radius:50%;
outline:none;
margin: 0; padding: 0;
}
input[type='radio']:before {
content: '';
display: block;
width: 100%;
height: 100%;
margin: 0;
border-radius: 50%;
border: 3px solid white;
}
input[type='radio']:checked:before {
background:red;
}
input[type='radio']:checked {
border:2px solid red;
}
/* ...AND CHECKBOX STYLING! */
input[type='checkbox'] {
-webkit-appearance:none;
width:18px;
height:18px;
border:2px solid black;
border-radius:25%;
outline:none;
margin: 0; padding: 0;
vertical-align: text-top;
}
input[type='checkbox']:before {
content: '';
display: block;
width: 100%;
height: 100%;
margin: 0;
border-radius: 45%;
border: 3px solid white;
}
input[type='checkbox']:checked:before {
background: #f36b24;
}
input[type='checkbox']:checked {
border:2px solid #f36b24;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment