Reputation: 4862
What is the best way to customize a radio box like this. It should be for ie10, chrome, firefox. I cant make everything by by own with css and javascript. is there a better way ?
concept:
Upvotes: 2
Views: 107
Reputation: 16709
Hide inputs, and style labels:
input[type='checkbox']{
display: none;
}
label{
border: 1px solid #ddd;
padding: 10px;
position: relative;
padding-left: 36px;
}
label::before{
position: absolute;
left: 10px;
top: 10px;
content: '';
box-shadow: 0px 0px 2px #999;
border: 2px solid #fff;
width: 12px;
height: 12px;
}
input:checked + label::before{
background: #ccc;
}
Upvotes: 4
Reputation: 461
I recently tried something like this and the following tutorials helped me http://css-tricks.com/snippets/css/custom-radio-buttons/ http://www.hongkiat.com/blog/css3-checkbox-radio/
In my case I used the background-image solution
Upvotes: 1