[温故知新] Text-level semantics

em

The em element represents stress emphasis of its contents.

突出强调其内容(重读),重音位置不同语句的含义也会改变。

em不是一个通用的italics元素。如果想在语句中突出一段文字,以不同的感情和语调朗读,i元素更适用这种情况。

em元素也没有传递重要性。如果想表达重要性,strong元素更合适。

strong

The strong element represents strong importance, seriousness, or urgency for its contents.

表示其内容有强烈的重要性、严重(肃)性、紧迫性。

重要性:strong元素可以用在结构性标题(heading)、说明性标题(caption)或段落中,用来将真正关键(really matter)部分与其他部分区别开来,比如详细解释文字、模式化文字(如:图片1)。

严重(肃)性:可以用在警告或提示上。

紧迫性:表示此部分内容要先于文档中的其他部分查看。

通过strong元素改变文字片断的重要程度,并不会改变语句的意义。

<h1>Chapter 1: <strong>The Praxis</strong></h1>

<figcaption>Figure 1. <strong>Ant colony dynamics</strong>. The ants in this colony are
affected by the heat source (upper left) and the food source (lower right).</figcaption>

small

The small element represents side comments such as small print.

表示旁注,如附属细则(small print)。

注:附属细则一般表现为免责说明、警告、法律限制或版权说明,有时也用于归属、许可要求。

注:对于由em元素强调过的或由strong元素标记为重要的文本,small元素不会取消对文本的强调,也不会降低这些文本的重要性。

<dl>
<dt>Single room
<dd>199 € <small>breakfast included, VAT not included</small>
<dt>Double room
<dd>239 € <small>breakfast included, VAT not included</small>
</dl>

s

The s element represents contents that are no longer accurate or no longer relevant.

表示内容已不准确或不再相关。

注:s元素不适用于文档编辑。如要表示一段文字已从文档中删除,请使用del元素。

<p>Buy our Iced Tea and Lemonade!</p>
<p><s>Recommended retail price: $3.99 per bottle</s></p>
<p><strong>Now selling for just $2.99 a bottle!</strong></p>

cite

The cite element represents a reference to a creative work. It must include the title of the work or the name of the author(person, people or organization) or an URL reference, which may be in an abbreviated form as per the conventions used for the addition of citation metadata.

引述,表示对于一个作品的引用。必须包括作品的标题或作者名称(个人、民族或组织)或URL地址。

<p>In the words of <cite>Charles Bukowski</cite> -
<q>An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way.</q></p>

q

The q element represents some phrasing content quoted from another source.

引文,引用自其他源的措辞内容。如果存在引用源,则用cite属性标识。引文如果放在引号内,则无需使用q元素。

<p>The W3C page <cite>About W3C</cite> says the W3C's
mission is <q cite="http://www.w3.org/Consortium/">To lead the
World Wide Web to its full potential by developing protocols and
guidelines that ensure long-term growth for the Web</q>. I
disagree with this mission.</p>

dfn

The dfn element represents the defining instance of a term.

表示一个术语定义实例,必须包括术语的释义。

The term <dfn>organic food</dfn> refers to food produced without synthetic chemicals.

i

The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose in a manner indicating a different quality of text, such as a taxonomic designation, a technical term, an idiomatic phrase from another language, transliteration, a thought, or a ship name in Western texts.

使用另外一种语气和情感的文字片断,或者使用有别于正常的讲述方式来表明文字的不同质量,如分类名称、技术术语、另一种语言的惯用语、音译、西文船舶名等。

鼓励开发者考虑是否有比i元素更恰当的元素使用,比如em表明突出强调,dfn表示一个术语的定义。

Lemonade consists primarily of <i>Citrus limon</i>.

b

The b element represents a span of text to which attention is being drawn for utilitarian purposes without conveying any extra importance and with no implication of an alternate voice or mood, such as key words in a document abstract, product names in a review, actionable words in interactive text-driven software, or an article lede.

仅为吸引注意力,并不传达额外的重要性也不暗含语气和情感的变化。比如文档摘要中的关键词、综述中的产品名称、交互式文本驱动软件中的可操作词语、一篇文章的首段。

实在无其他元素可用时,再考虑使用b元素吧。(这样看来,bi更适合用来标记icon?)

Take a <b>lemon</b> and squeeze it with a <b>juicer</b>.

u

The u element represents a span of text with an unarticulated, though explicitly rendered, non-textual annotation, such as labeling the text as being a proper name in Chinese text (a Chinese proper name mark), or labeling the text as being misspelt.

简单理解为中文的专名号。生拼硬凑词语,非文本解释,中文专有名词,或拼写错误文字。

The mixture of apple juice and <u class="spelling">eldeflower</u> juice is very pleasant.

mark

The mark element represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context.

标记和高亮显式与用户当前行为相关的内容。最常用的场景是用户搜索文档,将与搜索关键字相匹配的文字高亮显式。语法高亮,span更合适。

Elderflower cordial, with one <mark>part</mark> cordial to ten <mark>part</mark>s water, stands a<mark>part</mark> from the rest.

参考资料:

text-level-semantics

《[温故知新] Text-level semantics》有1个想法

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注