Making an h2 tag with a strong tag inside accessible

后端 未结 3 1557
清歌不尽
清歌不尽 2021-01-24 18:55

So this may seem like a very simple question but I can\'t get my head around it. I have the following HTML:

word 1 - word 2

3条回答
  •  北海茫月
    2021-01-24 19:22

    You can perfectly put a strong element inside a heading. It is semantically correct.

    https://www.w3.org/TR/html5/text-level-semantics.html#the-strong-element

    Importance: The strong element can be used in a heading, caption, or paragraph to distinguish the part that really matters from other parts of the that might be more detailed, more jovial, or merely boilerplate.

    Your problem of "weird reading" reflects a problem within the use or behavior of your screen reader, not from your syntax.

提交回复
热议问题