Maison >interface Web >Tutoriel H5 ><acronym> 和 <abbr> 这两个标签有什么本质上的区别吗?
ABBR: Indicates an abbreviated form (e.g., WWW, HTTP, URI, Mass., etc.).这里的 abbr 应该就比较接近上面图中灰色背景的部分(实质上也不尽然),而 acronym 就是黄色背景的部分了。我想区分这两类缩写,可能最有用就在于,在使用读屏器进行朗读 acronym 内容时,可以给出比较准确的发音。比如根据 CSS 2.1 的语音样式(Aural style sheets),我们可以给读屏器提供这样的样式:
ACRONYM: Indicates an acronym (e.g., WAC, radar, etc.).
<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)。本质区别就是语义不同。但这样的语义划分过于繁琐、细碎了。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.
…
<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>