隐藏表单标签会影响 Web 可访问性吗?

发布于 2024-09-02 09:30:08 字数 379 浏览 0 评论 0原文

我有一份运输表格。送货地址周围有三个输入字段。

以下是标签(以及括号中的“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

云朵有点甜 2024-09-09 09:30:09

您是否需要向用户显示标签?如果没有,请使用 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.

盛夏已如深秋| 2024-09-09 09:30:09

据我了解,您有三个字段,只能填写一两个字段。
为什么不要求用户选择哪个字段填充有选项。

尼古拉斯

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文