隐藏表单标签会影响 Web 可访问性吗?
我有一份运输表格。送货地址周围有三个输入字段。
以下是标签(以及括号中的“for”值)
1) 地址/邮政信箱 (for="shipAddress1")
2) 地址 2(对于“shipAddress2”)
3) 仅用于国际地址(for="shipAddress3")
我们的设计师建议将它们简单地标记为“街道地址或邮政信箱”,但我仍然想呈现这 3 个标签以实现 Web 可访问性(对吗?)。
我应该如何处理第 1、2 和 3 项?上面的 3 - 我应该应用 text-indent:-1000em;
或类似的东西。我假设使用 display:none
意味着屏幕阅读器也看不到它们,对吧?
想法?
I have a shipping form. Three input fields surround the shipping address.
Below are the labels (and in parenthesis their "for" values)
1) Address/P.O. Box (for="shipAddress1")
2) Address 2 (for="shipAddress2")
3) Use for International Address only(for="shipAddress3")
Our designer has proposed to label them simple as "Street Address or P/O Box", but I still want to present these 3 labels for Web Accessibility (right?).
What should I do with items 1, 2, & 3 above -- should I apply a text-indent:-1000em;
or something like that. I'm assuming using display:none
mean screen reader can't see them also, right?
Thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否需要向用户显示标签?如果没有,请使用
text-indent:-999px
将它们放置在页面之外。屏幕阅读器不会读取Display:none
。这是关于定位而不是隐藏以实现可访问性的一个很好的概述:http://www.nickfitz.co.uk/2007/02/14/why-left-9999px-is-better-for-accessibility-than-display-none /
不过,我并不完全确定您需要向用户展示什么。你的问题有点令人困惑。
Do you need to show the labels to the user or not? If not, use
text-indent:-999px
to position them off the page.Display:none
will not be picked up by screen readers.This is a good overview on positioning rather than hiding for accessibility: http://www.nickfitz.co.uk/2007/02/14/why-left-9999px-is-better-for-accessibility-than-display-none/
Still, I'm not entirely sure what you need to show your users. Your question is a bit confusing.
据我了解,您有三个字段,只能填写一两个字段。
为什么不要求用户选择哪个字段填充有选项。
尼古拉斯
As I understand you have three field, only one or two can be filled.
Why not ask the user to choose which filed is filled with an option.
Nicolas