0

I read the explanation on the W3C website but for me the definition isn’t satisfying. Can anybody paraphrase this?

As I understand, it should be used in cases when a certain part of a text references to another context, like e.g. another text part or a search string I entered.

I don’t get the examples with the quotations—where’s the referential meaning when highlighting a part of a quotation just to gather the readers’ attention or mark a part of a quotation to emphasize it?

4

1 回答 1

1

用HTML5 Doctor的话来说,也可以参考一篇get到的文章:“ Draw attention with mark ”。

来自 w3c.org:4.6.19标记元素

由于在另一个上下文中的相关性,mark 元素表示一个文档中为参考目的而标记或突出显示的一系列文本。当用于引文或散文中提到的其他文本块时,它表示最初没有出现但已添加的亮点,以使读者注意可能未被认为重要的文本部分最初编写该块时的原始作者,但现在受到了以前意想不到的审查。在文档的主要散文中使用时,它表示由于可能与用户当前活动相关而突出显示的文档部分。

开头提到的文章的最后一部分也谈到了这个标签的语义:

strong 和 em 的区别

以前,您可能已经使用 em 和 strong 分别为文本部分添加强调或重要性。标记与这两个不同,因为它纯粹用于突出一段文本与用户和/或页面内容的相关性。过去您可能为此使用了 em 和 strong ,由于缺乏更好的元素,这在当时可以说是有效的,但是引入 mark 仅仅意味着它们的使用会更加严格。

当您需要指出一段文本的重要性时使用strong,例如错误或警告信息,em 应该用于强调文本,强调单词以适应句子的含义。

于 2013-03-17T20:06:12.850 回答