So I am creating my portfolio right now and I want to put emphasis on some words inside my paragraph by changing their color. I’ve been using the mark tag, which makes sure screen readers are aware of the emphasis, but it also acts as if the mark tag is separate from the paragraph; making the screen reader stop until the user continues manually.
I just want to make sure this is not an accessibility concern. Here is my code:
<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>
If anyone could provide some tips that would be very appreciated. I just want to learn a little more about accessibility and ways to keep a good visual style at no cost.
2
Answers
I would like to recommend you to use
<strong>
or you can use<em>
instead of<mark>
for better screen reader support, because they are better for inline emphasis and are treated more naturally by screen readers.The
<mark>
element is not for denoting emphasis. It is for—A
<strong>
element is most appropriate here. It is—As you’ve encountered, some screen readers will pause when encountering inline tags. There are settings and modes in some screen readers that will stop that pause from happening. But regardless, it’s expected behavior, and using a
<strong>
is the correct way to denote these semantics for all users, including screen reader users.