3 ms·
At work we sometimes use asp:Label instead of just putting out the text since with labels we can get a tooltip. We typically use this in table cells to present
by Flow 16y ago
At work we sometimes use asp:Label instead of just putting out the text since with labels we can get a tooltip. We typically use this in table cells to present only 20 chars of a string, and have the full string as a tooltip(alt="the tooltip").
The label doesn't have a "for" attribute.
I wonder how those tools blind use are affected by this. Do you happen to know?
- bphogan 16y agoif the label wraps the form field it's associated with, you should be ok. However, the "alt" attribute is completely inappropriate for tooltips. If you're looking to do something like that you should provide real tooltip functionality either using the title attribute, or better, display text right next to the field that's visible, which you turn into tooltips when JS is enabled. Then everyone wins. From HTML4's spec: "The alt attribute specifies alternate text that is rendered when the image cannot be displayed (see below for information on how to specify alternate text ). User agents must render alternate text when they cannot support images, they cannot support a certain image type or when they are configured not to display images."
- Flow 16y agoI checked the actual HTML generated by the asp:Label control. When no control is associated with the label, the control renders into a span element and uses a title attribute on the span to create the tooltip. Is this still a problem for accessability software?