段落中嵌套的span/mark标签的可访问性问题

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

所以我现在正在创建我的作品集,我想通过改变段落中的一些单词的颜色来强调它们。我一直在使用 mark 标签,它可以确保屏幕阅读器意识到重点,但它也就像标记标签与段落分开一样;使屏幕阅读器停止,直到用户手动继续。

我只是想确保这不是可访问性问题。这是我的代码:

<p>
  Having <mark class="blue">authority</mark> over your brand is important in business. You decide how you want your brand to be <mark class="blue">perceived</mark>, interacted with, and <mark class="blue">connected</mark> to your community. If you ever need guidance on any of these aspects, I am more than willing to provide feedback and services related to brand identity.
</p>

如果有人可以提供一些提示,我们将不胜感激。我只是想更多地了解可访问性以及免费保持良好视觉风格的方法。

javascript html css accessibility
1个回答
0
投票

我建议您使用

<strong>
,或者您可以使用
<em>
代替
<mark>
以获得更好的屏幕阅读器支持,因为它们更适合内联强调,并且屏幕阅读器更自然地对待它们。

<p>
  Having <strong class="blue">authority</strong> over your brand is important in business. You decide how you want your brand to be <strong class="blue">perceived</strong>, interacted with, and <strong class="blue">connected</strong> to your community.
</p>
© www.soinside.com 2019 - 2024. All rights reserved.