mercredi 24 juin 2015

Unclickable space between label and checkbox if label has no background color

I have checkbox inside label (so that user can click either on checbox or label). The problem is in Chrome there is small space between checkbox and label where clicks are not detected. I added yellow background color to see where the label ends and suddenly it worked. Does anyone knows why? Now I just added white background color in working code but I am really curious.

<body>
  Between CheckBox1 and it's label is small unclickable space in chrome. In CheckBox2 there is not. The only difference is that label of CheckBox2 has set yellow background color. WTF?
  <div>
    <label><input type="checkbox" />CheckBox1</label>
  </div>
  <div>
    <label style="background-color: yellow;"><input type="checkbox" />CheckBox2</label>
  </div>
</body>



Aucun commentaire:

Enregistrer un commentaire