HTML 文档标记以实现可访问性

发布于 2024-10-14 12:43:57 字数 340 浏览 9 评论 0原文

我想知道构建类似文档的 html 页面的正确方法。显然,页面标题应标记为

,章节标题应标记为

至于页脚,现在,我有:

<div id="footer">Footer content</div>

这将显示在文档的每一页中。我意识到屏幕阅读器在阅读页脚内容时不会通知用户。我觉得用户应该可以选择跳过阅读页脚内容。

是否有必要让屏幕阅读器宣布它将读取页脚内容,并且有适当的方法吗?

谢谢!

I was wondering about a proper way of structuring a document-like html page. It's obvious that the title of the page should be marked as <h1> and section headings as <h2>.

As for the footer, right now, I have:

<div id="footer">Footer content</div>

and this will be displayed in every page of the document. I realized that screen reader will not notify the users if it's reading the footer content. I feel that uses should have the option to skip reading the footer content.

Is it necessary to let screen reader announce that it's going to read the footer content and is there a proper way to do so?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

橘亓 2024-10-21 12:43:57

允许屏幕阅读器跳过网站重复部分的常见方法是在您要跳过的元素后面的位置添加隐藏的锚点。

例如,在我们的一个网站上,我们这样做是为了允许跳过导航栏。

<div id="navbar">
  <a title="Skip Navigation" href="#skipnav"></a>
  <a href="/"><img id="home" src="transparent.gif" alt="Home" /></a>
  ...
</div>
<a id="skipnav"></a>

可以使用键盘选择“跳过导航”a,屏幕阅读器将读取“跳过导航”。然后,用户可以“单击”它以稍后跳转到该页面。在这种情况下,就在导航之后。

A common way to allow screen readers to skip over repeated parts of your website are to include hidden a anchor to a position right after the element you'd like to skip.

For example, on one of our websites, we do this to allow skipping over our navigation bar.

<div id="navbar">
  <a title="Skip Navigation" href="#skipnav"></a>
  <a href="/"><img id="home" src="transparent.gif" alt="Home" /></a>
  ...
</div>
<a id="skipnav"></a>

The "Skip Navigation" a is selectable by using the keyboard and the screen reader will read "Skip Navigation". The user can then "click" on it to jump later into the page. In this case, right after the navigation.

满地尘埃落定 2024-10-21 12:43:57

可以用html5吗?如果是这样,它包含一个

标记。

Can you use html5? If so it contains a <footer> tag.

几度春秋 2024-10-21 12:43:57

我是屏幕阅读器用户,h1 和 h2 标题效果很好。没有好的方法可以让屏幕阅读器跳过我知道的某些文本,这些文本适用于所有屏幕阅读器和浏览器。假设您的内容如下所示,

<h1>title</h1>
<h2>section1</h2>
section content
<div id="footer">Footer content</div>
<h2>section2</h2>
section 2 content
<div id="footer">Footer content</div>

屏幕阅读器用户应该能够在第一次听到后发现他们再次点击了页脚。然后,他们可以使用所有现代屏幕阅读器提供的快速导航键跳至下一个标题,从而不再收听页脚。

I'm a screen reader user and the h1 and h2 headings will work well. There's no good way to allow a screen reader to skip certain text that I know of which will work with all screen readers and browsers. Assuming your content is something like the following though

<h1>title</h1>
<h2>section1</h2>
section content
<div id="footer">Footer content</div>
<h2>section2</h2>
section 2 content
<div id="footer">Footer content</div>

A screen reader user should be able to figure out they hit the footer again after hearing it the first time. They can then use quick navigation keys provided by all modern screen readers to skip to the next heading thus not listening to the footer again.

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