<address>: The Contact Address element

<address> HTML 元素指示所附 HTML 提供一个人或多个人或组织的联系信息。

¥The <address> HTML element indicates that the enclosed HTML provides contact information for a person or people, or for an organization.

Try it

<address> 元素的内容提供的联系信息可以采用适合上下文的任何形式,并且可以包括所需的任何类型的联系信息,例如物理地址、URL、电子邮件地址、调用号码、社交媒体句柄、地理地址。 坐标等。<address> 元素应包括联系信息所涉及的个人、人员或组织的名称。

¥The contact information provided by an <address> element's contents can take whatever form is appropriate for the context, and may include any type of contact information that is needed, such as a physical address, URL, email address, phone number, social media handle, geographic coordinates, and so forth. The <address> element should include the name of the person, people, or organization to which the contact information refers.

<address> 可用于多种上下文,例如在页眉中提供企业的联系信息,或通过在 <article> 中包含 <address> 元素来指示文章的作者。

¥<address> can be used in a variety of contexts, such as providing a business's contact information in the page header, or indicating the author of an article by including an <address> element within the <article>.

属性

¥Attributes

该元素仅包含 全局属性

¥This element only includes the global attributes.

使用说明

¥Usage notes

  • <address> 元素只能用于表示其最近的 <article><body> 元素祖级的联系信息。
  • 该元素不应包含比联系信息更多的信息,例如发布日期(属于 <time> 元素)。
  • 通常,<address> 元素可以放置在当前节的 <footer> 元素(如果有)内。

示例

¥Examples

此示例演示如何使用 <address> 来划分文章作者的联系信息。

¥This example demonstrates the use of <address> to demarcate the contact information for an article's author.

html
<address>
  You can contact author at
  <a href="http://www.example.com/contact">www.example.com</a>.<br />
  If you see any bugs, please
  <a href="mailto:webmaster@example.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>

结果

¥Result

尽管它使用与 <i><em> 元素相同的默认样式呈现文本,但在处理联系信息时使用 <address> 更合适,因为它传达了额外的语义信息。

¥Although it renders text with the same default styling as the <i> or <em> elements, it is more appropriate to use <address> when dealing with contact information, as it conveys additional semantic information.

技术总结

¥Technical summary

内容类别 流量内容,可触及的内容。
允许的内容 流量内容,但没有嵌套的 <address> 元素,没有标题内容(<hgroup>h1h2h3h4h5h6),没有分段内容(<article><aside><section><nav>),并且没有 <header><footer> 元素。
标签遗漏 无,开始和结束标记都是强制性的。
允许的父级 任何接受 流动内容 的元素,但始终排除 <address> 元素(根据对称逻辑原理,如果 <address> 标签作为父元素,则不能嵌套 <address> 元素,则相同的 <address> 内容不能有 <address> 标签作为其父元素)。
隐式 ARIA 角色 group
允许的 ARIA 角色 任何
DOM 接口 HTMLElement 在 Gecko 2.0 (Firefox 4) 之前,Gecko 使用 HTMLSpanElement 接口实现此元素

规范

Specification
HTML Standard
# the-address-element

¥Specifications

浏览器兼容性

BCD tables only load in the browser

¥Browser compatibility

也可以看看

¥See also