I am making a styled rounded checkbox for woocommerce . The Problem is my checkbox is now fill inside . How Can I make it thin inside without filling?
input#createaccount:checked {
background-color: #253849;
}
input#createaccount{
position: relative;
margin-left: 4px;
width: 25px;
float: left;
margin: 2px 10px 2px 1px;
height: 25px;
border-radius: 50%;
vertical-align: middle;
border: 4px solid #295282;
-webkit-appearance: none;
outline: none;
cursor: pointer;
}
<input class="input-checkbox" id="createaccount" type="checkbox" name="createaccount" value="1">
3
Answers
Simple adding inner shadow solve the issue
One way to do this without javascript would be to create one wrapper element with input and one more element as a indicator for checkbox state. That way you can use selector
input:checked + nextElement
and change style of second element based on checkbox status.Then you just have to hide checkbox with
opacity: 0
. With this approach you can also use transitions and transforms on the inner element.Here is another trick with a simple background where you color the content-box and you animate the padding. You will also have transparency: