Im using the Bootstrap plugin awesome-bootstrap-ckeckbox, Im working with ASP.NET MVC too, then all my checkbox render two inputs, one as a checkbox input and another as a hidden input, because of that I modified the CSS selector, for example:
HTML Code
<div class="checkbox">
<input id="checkbox1" type="checkbox">
<input type="hidden" />
<label for="checkbox1">
Default
</label>
</div>
<div class="checkbox checkbox-primary">
<input id="checkbox2" type="checkbox" checked>
<input type="hidden" />
<label for="checkbox2">
Primary
</label>
</div>
CSS Code
/* awesome-bootstrap-checkbox */
.checkbox input[type="checkbox"]:checked + label::after {
font-family: 'FontAwesome';
content: "\f00c";
}
.checkbox input[type="checkbox"]:disabled + label::before {
background-color: #eeeeee;
cursor: not-allowed;
}
.checkbox-primary input[type="checkbox"]:checked + label::before {
background-color: #428bca;
border-color: #428bca;
}
.checkbox-primary input[type="checkbox"]:checked + label::after {
color: #fff;
}
/* my own version */
.checkbox input[type="checkbox"]:checked + input + label::after {
font-family: 'FontAwesome';
content: "\f00c";
}
.checkbox input[type="checkbox"]:disabled + input + label::before {
background-color: #eeeeee;
cursor: not-allowed;
}
.checkbox-primary input[type="checkbox"]:checked + input + label::before {
background-color: #428bca;
border-color: #428bca;
}
.checkbox-primary input[type="checkbox"]:checked + input + label::after {
color: #fff;
}
That works great in all modern browser except Safari 7.1, incredibly the original works but my modification not, I think the problem is with the sibling selector. Any idea???
Plunker Code: Example