按字面层次或重要性组织标题?

发布于 2024-11-18 05:24:57 字数 350 浏览 2 评论 0原文

我希望在语义上准确并且对于屏幕阅读器来说清晰易读。

我想知道这个特殊情况... 我的结构如下:

Current Promotion:
-Promotion Title

Recent Blog Posts:
-BlogPost Title
-BlogPost TItle

从风格上来说,为了更好地阅读,我认为各个项目的标题应该大于章节标题,这基本上是有组织的......不会让任何人太兴奋。

所以我想知道是否应该根据“重要性”将各个标题设为 h2s,将章节标题设为 h3s,还是根据字面层次结构将其保留为相反?

这可能不是一个主要问题,但我不确定正确的行动方针是什么。

I want to be accurate semantically and legible for screen-readers.

I'm wondering about this particular situation...
I have a structure like:

Current Promotion:
-Promotion Title

Recent Blog Posts:
-BlogPost Title
-BlogPost TItle

Stylistically and for better reading, I think that the titles of the individual items should be larger than the section titles, which are basically organizational.. not going to get anyone too excited.

So I'm wondering if I should have the individual titles be h2s and the section headings be h3s based on 'importance' or leave it the reverse based on literal hierarchy?

It may not be a major issue, but I'm not sure what the right course of action is.

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

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

发布评论

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

评论(1

-小熊_ 2024-11-25 05:24:57

标题应反映层次结构:

来自 WebAIM,一个有用的辅助功能资源:

页面应该以分层方式构建,一级标题 () 是最重要的(通常是页面标题或标题),然后是二级标题(通常是主要章节标题),再到三级标题(页面的子章节)。 ), 等等。

一些屏幕阅读器(例如 NVDA)向最终用户提供结构化的标题列表;如果 H3 中有 H2,那么列表会变得混乱,并且看起来 H3 部分标题实际上是先前内容的子部分:

Current Promotion:

Promotion Title
- Recent Blog Posts:

BlogPost Title
BlogPost TItle

Headings should reflect hierarchy:

From WebAIM, a useful accessibility resource:

Pages should be structured in a hierarchical manner, with 1st degree headings () being the most important (usually page titles or heading), then 2nd degree headings ( - usually major section headings), down to 3rd degree headings (sub-sections of the ), and so on.

Some screenreaders - such as NVDA - present a structured list of headings to the end-user; if you have H2's within H3's, then the list will get messed up, and will instead look like your H3 section headers are actually sub-sections from the previous content:

Current Promotion:

Promotion Title
- Recent Blog Posts:

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