根据规范,标题(书籍、电影等)的正确语义 HTML 标记是什么?它是 <em> 标记还是其他?

What is the correct semantic HTML markup for a title (book, movie, etc.), according to the spec? Is it an <em> tag, or something else?

我正在尝试确定 HTML 我用于标题(书籍、电影、歌曲等)的最佳做法。我试图弄清楚 <em> 是正确的,还是斜体的 <span> 或其他。根据 HTML 规范或惯例,使用 <em> tag/element 作为标题在语义上是否正确?

例如,这是一本书的书评摘录,标题为:"Reaching & Teaching Them All",我想知道如何标记标题本身:

"Initial meetings with students are key to making a good first impression and offer a critical opportunity to put children at ease. By carefully orchestrating your relationship with students in those early encounters, you can create a better learning environment that will help to encourage listening and learning. Reaching & Teaching Them All suggests various ways for getting and maintaining student attention and interest, including telling stories, playing games, embracing body language, and using humour and sarcasm."

好吧,问题是:标题本身并不 强调 。所以,如果你的目标是语义意义,我认为简单的答案是:不,<em> 不是正确的选择。

Mozilla 提供了一个很好的简单指南,in their docs on <em>。这不是佳能,但非常接近:

The element is for words that have a stressed emphasis compared to surrounding text, which is often limited to a word or words of a sentence and affects the meaning of the sentence itself.

因此,除非您要改变句子的意思或重音,否则不建议使用 <em>。相反,他们建议:

Use the <cite> element to mark the title of a work (book, play, song, etc.).

然后,使用 CSS 将 <cite> 的显示样式设置为斜体。