什么时候我不需要使用h1-h6标题来创建强调文本

问题描述 投票:0回答:1

我可以使用如下语法吗

<span class="subheader-uline">My custom emphasised txt</span>

在不违反可访问性规则(WCAG)的情况下,我不打算通过屏幕阅读器导航此自定义标题 - 它纯粹是为了美观。

我尝试使用此语法,它在可访问性中被标记为非法,说明我应该使用我不想做的 h1 - h6 标签。

html accessibility wcag
1个回答
0
投票

您可以尝试使用 aria-hidden 从辅助功能 API 中隐藏非交互式内容。

<span class="subheader-uline" aria-hidden="true">My custom emphasised txt</span>
© www.soinside.com 2019 - 2024. All rights reserved.