<abbr>

总结

该属性在HTML(或HTML缩写元素)中表示一个缩写形式并提供完整的描述它,如果存在该属性,title属性必须包含这个完整描述,而没有其他。比如 "Inc."、"etc."。通过对缩写词语进行标记,您就能够为浏览器、拼写检查程序、翻译系统以及搜索引擎分度器提供有用的信息。

使用说明: 当存在该属性时, 符合语法的title属性中的文字数量应该与内容中的<abbr>属性的数量相对应。This is also the case in languages with more than two grammatical numbers (for example, Arabic not only has singular and plural categories, but also a dual category).

Attributes

This element only includes the global attributes.

Use the title attribute to define the full description of the abbreviation. Many user agents present this as a tooltip.

Default styling

The purpose of this element is purely for the convenience of the author and all browsers display it inline (display: inline) by default, though its default styling varies from one browser to another:

  • Some browsers, like Internet Explorer, do not style it differently than a <span> element.
  • Opera, Firefox, and some others add a dotted underline to the content of the element.
  • A few browsers not only add a dotted underline, but also put it in small caps; to avoid this styling, adding something like font-variant: none in the CSS takes care of this case.

It is therefore strongly recommended that web authors not rely on the default styling. Note that this element is not supported by Internet Explorer prior to IE7. As these IE versions don't allow styling for unknown elements, the following script is necessary to allow it:

<!--[if lte IE 6]>
  <script>
    document.createElement("abbr");
  </script>
<![endif]-->

Example

<p>Tony Blair is the prime minister of the <abbr title="United Kingdom">UK</abbr></p>

Result

Image:Abbr.gif

Tony Blair is the prime minister of the UK

Specifications

Specification Status Comment
WHATWG HTML Living Standard Living Standard  
HTML5 Candidate Recommendation  
HTML 4.01 Specification Recommendation  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support

2.0 or earlier

1.0 (1.7) or earlier

7.0

1.3 or earlier

(Yes)
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) (Yes) (Yes) (Yes)

See also

HTML元素
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 
(快速链接 HTML Category)

附件

文件 大小 日期 附加者为
e-resize.gif
88 字节 2009-04-21 16:01:46 Jürgen Jeka
Abbr.gif
1814 字节 2006-02-08 06:05:23 Rappo

Document Tags and Contributors

Contributors to this page: jessiecaisme
最后编辑者: jessiecaisme,