문제

Does including formatting within a <label> element have any positive or negative effect on screen readers (or any other disability support equipment)?

For example, would either of the following cause issues?

<label for="txtName"><b>Name:</b></label> <input type="text" id="txtName"/>

<label><b>Name:</b> <input type="text" id="txtName"/></label> 

Or should it be...

<b><label for="txtName">Name:</label></b> <input type="text" id="txtName"/>

<b><label>Name: <input type="text" id="txtName"/></label></b>

Does it make any difference?

도움이 되었습니까?

해결책

No, this doesn't affect screen readers in any way. Screen readers ignore attributes such as bold by default, but they can be set to speak and/or indicate them in Braille.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top