<address>
HTML <address> 元素 表示其中的 HTML 提供了某个人或某个组织(等等)的联系信息。
尝试一下
由<address>元素中任何形式的内容所提供的联系信息适用于上下文的背景信息,可以是必要的任何一种联系方式,比如真实地址、URL、电子邮箱、电话号码、社交媒体账号、地理坐标等等。此元素应该包含联系信息对应的个人、团体或组织的名称。
<address>可以使用在多种语境中,例如在文章开头提供商务的联系方式,或者放在<article>元素内,指明该文章的作者。
| 内容分类 | Flow content (en-US), palpable content. |
|---|---|
| 允许的内容 | Flow content (en-US), 但是不能嵌套<address>元素, 不能是头部内容 (<hgroup>, <h1> (en-US), <h2> (en-US), <h3> (en-US), <h4> (en-US), <h5> (en-US), <h6> (en-US)), 不能是区块内容 (<article>, <aside>, <section>, <nav>), 不能是<header> 或 <footer>元素。 |
| 标签省略 | 不允许,开始标签和结束标签都不能省略。 |
| 允许的父元素 | Any element that accepts flow content (en-US), but always excluding <address> elements (according to the logical principle of symmetry, if <address> tag, as a parent, can not have nested <address> element, then the same <address> content can not have <address> tag as its parent). |
| 允许的 ARIA 角色 | 无 |
| DOM 接口 | HTMLElement 在 Gecko 2.0(Firefox 4)以前,Gecko 使用 HTMLSpanElement 接口实现这个元素 |
属性
此元素只有全局属性。
用法说明
示例
这个例子演示了如何使用 <address> 表示一篇文章的作者的联系信息。
html
<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>
331 E Evelyn Ave<br>
Mountain View, CA 94041<br>
USA
</address>
结果
规范
| Specification |
|---|
| HTML Standard # the-address-element |
浏览器兼容性
BCD tables only load in the browser
参见
- Others section-related elements:
<body>,<nav>,<article>,<aside>,<h1>(en-US),<h2>(en-US),<h3>(en-US),<h4>(en-US),<h5>(en-US),<h6>(en-US),<hgroup>,<footer>,<section>,<header>; - 使用 HTML 章节和大纲