jeudi 2 août 2018

Make checkbox clickable outside label

I have a checkbox with pseudo div class inside a label. I have to position checkbox(div) with negative right property, which makes the checkbox to be outside label and unclickable. Is there any way to make it clickable without changing html?

<label>
 <span>text</span>
  <input type="checkbox"/>
   <div></div>
</label>

css

input[type="checkbox"] + div::before {
 right:-35px !important;
  left:auto !important; }

input[type="checkbox"] + div::after {
 left:auto !important;
  right:-33px !important;
   width:auto; }




Aucun commentaire:

Enregistrer un commentaire