简介
HTML 的<address>元素可以让作者为它最近的<article>或者<body>祖先元素提供联系信息。在后一种情况下,它应用于整个文档。
用法说明:
- 内容分类 Flow content, palpable content
- 允许的内容 Flow content,但是不能是内嵌的<address>元素、heading content(
<hgroup>、<h1>、<h2>、<h3>、<h4>、<h5>、<h6>)、sectioning content(<article>、<aside>,<section>、<nav>)、<header>或者<footer>元素 - 标签省略 不允许省略,开始标签和结束标签都是必需的
- 允许的父元素 任何接受flow content的元素
- DOM接口
HTMLElement在Gecko 2.0 (Firefox 4)之前,Gecko 使用接口HTMLSpanElement实现这个元素
属性
这个元素只有全局属性。
示例
<address>
You can contact author at <a href="http://www.somedomain.com/contact">www.somedomain.com</a>.<br>
If you see any bugs, please <a href="mailto:webmaster@somedomain.com">contact webmaster</a>.<br>
You may also want to visit us:<br>
Mozilla Foundation<br>
1981 Landings Drive<br>
Building K<br>
Mountain View, CA 94043-0801<br>
USA
</address>
上面的HTML的输出如下:

虽然<address>元素使用<i>或者<em>元素的默认样式渲染文本,但是当处理联系信息时使用<address>元素更合适,因为它表达了额外的语义信息。
规范
| Specification | Status | Comment |
|---|---|---|
| WHATWG HTML Living Standard <address> |
Living Standard | |
| HTML5 <address> |
Recommendation | |
| HTML 4.01 Specification <address> |
Recommendation |
浏览器兼容
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | (Yes) | 1.0 (1.7 or earlier) | 1.0 | 5.12 | 1.0 |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mini | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | (Yes) | 1.0 (1.7) | (Yes) | (Yes) | (Yes) | (Yes) |
另请参阅
- Others section-related elements:
<body>,<nav>,<article>,<aside>,<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<hgroup>,<footer>,<section>,<header>; - Sections and outlines of an HTML5 document.