Heim  >  Artikel  >  Web-Frontend  >  <acronym> 和 <abbr> 这两个标签有什么本质上的区别吗?

<acronym> 和 <abbr> 这两个标签有什么本质上的区别吗?

WBOY
WBOYOriginal
2016-06-07 08:42:592300Durchsuche

回复内容:

<acronym> 和 <abbr> 这两个标签有什么本质上的区别吗?简单画了一个图,不确定我的理解是否精准。

  • abbreviation 从广义上来说是一个宽泛的概念,日常可以用于描述各种缩写。
  • initialism 指的是最容易理解的「首字母缩写」,人们在朗读的时候会把字母一个个念出来。
  • acronym 起初也是指首字母缩写,但逐渐地,人们把它和 initialism 区分开来了。差异之处在于,acronym 表示的缩写可以单词的形式读出来,甚至有些不完全是首字母缩写也可以算 acronym,还有些 acronym 都已经成为很常规的单词,甚至都不需要大写了。

对于 W3C 的标准,HTML 4.01 中(Paragraphs, Lines, and Phrases):
ABBR: Indicates an abbreviated form (e.g., WWW, HTTP, URI, Mass., etc.).
ACRONYM:
Indicates an acronym (e.g., WAC, radar, etc.).
这里的 abbr 应该就比较接近上面图中灰色背景的部分(实质上也不尽然),而 acronym 就是黄色背景的部分了。我想区分这两类缩写,可能最有用就在于,在使用读屏器进行朗读 acronym 内容时,可以给出比较准确的发音。比如根据 CSS 2.1 的语音样式(Aural style sheets),我们可以给读屏器提供这样的样式:
<code class="language-css"><span class="nt">abbr</span> <span class="p">{</span> <span class="k">speak</span><span class="o">:</span> <span class="k">spell-out</span><span class="p">;</span> <span class="p">}</span>
<span class="nt">acronym</span> <span class="p">{</span> <span class="k">speak</span><span class="o">:</span> <span class="k">normal</span><span class="p">;</span> <span class="p">}</span>
</code>
当初仅仅是为了分别标记一般的 abbreviation 和 acronym(acronym 特指一类特殊的 abbreviation)。本质区别就是语义不同。但这样的语义划分过于繁琐、细碎了。

所以 HTML5 已经弃用了
11 Obsolete features
11.2 Non-conforming features

Elements in the following list are entirely obsolete, and must not be used by authors:

: Use instead.

不要再用 了。知道它的历史就行了,也别多想了。 是缩短词,规则不限,比如 min. (minute), Inc. (including), etc. (et cetera), FBI 等等。

是一种特殊的 ,一般以每个单词开头的一部分(通常是首字母)组成,且发音通常以组合后的词为准:

<code class="language-text"><acronym title="North Atlantic Treaty Organization">NATO</acronym>
<acronym title="Sound Navigation and Ranging">Sonar</acronym>
<abbr title="Hyper Text Mark-up Language">HTML</abbr>
<abbr title="Federal Bureau of Investigation">FBI</abbr>
</code>
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn