CSS: suppress hover effect for dissociate and

  Kiến thức lập trình

In below example, CSS “helpfully” triggers input:hover when the label is hovered. How can this label hover effect be suppressed with only changing the CSS, so that the input border only changes when it is hovered itself?

input:hover {
  border: 1px solid red;
}
<div><label for="foo">label</label></div>
<div><input id="foo"/></div>

LEAVE A COMMENT