lundi 6 avril 2015

Custom checkbox don't work

I'm using bootstrap 3 and another css template. I want to stylize a checkbox using the template and it isn't work, because I can't use the input area. When I click it, nothing appear. This is the code:


HTML:



<div class="checkbox check-primary ">
<input type="checkbox" value="">
<label>Guardar usuario</label>
</div>


CSS:



.checkbox {
display: block;
min-height: 20px;
vertical-align: middle;
}
.checkbox input[type=checkbox] {
display: none;
}
.checkbox label {
display: inline-block;
cursor: pointer;
position: relative;
padding-left: 25px;
margin-right: 15px;
font-size: 13px;
margin-bottom: 6px;
color: #777a80;
transition: border 0.2s linear 0s,color 0.2s linear 0s;
}

.checkbox label:before {
content: "";
display: inline-block;
width: 17px;
height: 17px;
margin-right: 10px;
position: absolute;
left: 0px;
top: 1.4px;
background-color: #fff;
border: 1px solid #c2c6cb;
border-radius: 3px;
transition: border 0.2s linear 0s,color 0.2s linear 0s;
}

.checkbox input[type=checkbox]:checked + label::after {
font-family: 'FontAwesome';
content: "\F00C";
}

.checkbox label::after {
display: inline-block;
width: 16px;
height: 16px;
position: absolute;
left: 3.2px;
top: 0px;
font-size: 11px;
transition: border 0.2s linear 0s,color 0.2s linear 0s;
}


That all. The checkbox only run when I get out this rule : .checkbox input[type=checkbox] { display: none; }


If I have a lot of mistakes, be patient, please! This is my first question and I am begginer in html, too.


THANKS!!


Aucun commentaire:

Enregistrer un commentaire