Links containing a Label tag are not clickable on IE

前端 未结 2 642
轻奢々
轻奢々 2021-01-20 18:54

I\'ve come across an unusual situation with general IE compatibility.

The following link is unclickable in IE, but fine on everything else (I\'ve tried IE8 onwards):

相关标签:
2条回答
  • 2021-01-20 19:10

    Labels are for form elements. In this context, they are being used incorrectly. Anyone using a screen reader will be confused by the markup, since upon "seeing" a label they are expecting a corresponding form element. A span element would be better suited, and would work across all browsers with minimal changes, since you're simply changing <label> for <span>.

    0 讨论(0)
  • 2021-01-20 19:23

    Doesn't using a label inside an a tag invalidate the html as a label is interactive content? You'd be better served using a span for this.

    0 讨论(0)
提交回复
热议问题