From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/html/element/address/index.html | 125 ++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 files/zh-cn/web/html/element/address/index.html (limited to 'files/zh-cn/web/html/element/address') diff --git a/files/zh-cn/web/html/element/address/index.html b/files/zh-cn/web/html/element/address/index.html new file mode 100644 index 0000000000..0de11f9078 --- /dev/null +++ b/files/zh-cn/web/html/element/address/index.html @@ -0,0 +1,125 @@ +--- +title:
+slug: Web/HTML/Element/address +tags: + - HTML + - 元素 +translation_of: Web/HTML/Element/address +--- +
{{HTMLRef}}
+ +

HTML <address> 元素 表示其中的 HTML 提供了某个人或某个组织(等等)的联系信息。

+ +
{{EmbedInteractiveExample("pages/tabbed/address.html", "tabbed-standard")}}
+ + + +

       由<address>元素中任何形式的内容所提供的联系信息适用于上下文的背景信息,可以是必要的任何一种联系方式,比如真实地址、URL、电子邮箱、电话号码、社交媒体账号、地理坐标等等。此元素应该包含联系信息对应的个人、团体或组织的名称。

+ +

      <address>可以使用在多种语境中,例如在文章开头提供商务的联系方式,或者放在{{HTMLElement("article")}}元素内,指明该文章的作者。

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
内容分类Flow content, palpable content.
允许的内容Flow content, 但是不能嵌套<address>元素, 不能是头部内容 ({{HTMLElement("hgroup")}}, {{HTMLElement("h1")}}, {{HTMLElement("h2")}}, {{HTMLElement("h3")}}, {{HTMLElement("h4")}}, {{HTMLElement("h5")}}, {{HTMLElement("h6")}}), 不能是区块内容 ({{HTMLElement("article")}}, {{HTMLElement("aside")}}, {{HTMLElement("section")}}, {{HTMLElement("nav")}}), 不能是{{HTMLElement("header")}} 或 {{HTMLElement("footer")}}元素.
标签省略{{no_tag_omission}}
允许的父元素Any element that accepts flow content, 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 接口{{domxref("HTMLElement")}} 在 Gecko 2.0(Firefox 4)以前,Gecko 使用 {{domxref("HTMLSpanElement")}} 接口实现这个元素
+ +

属性

+ +

此元素只有全局属性

+ +

用法说明

+ + + +

示例

+ +

这个例子演示了如何使用 <address> 表示一篇文章的作者的联系信息。

+ +
  <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>
+
+ +

结果

+ +

{{EmbedLiveSample("Example", "300", "200")}}

+ +

虽然 <address> 元素看起来只是使用了 {{HTMLElement("i")}} 或者 {{HTMLElement("em")}} 元素的默认样式来渲染其中的文本,但是当处理联系信息时使用它更为合适,因为它表达了额外的语义信息。

+ +

规范

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
规范状态备注
{{SpecName('HTML WHATWG', 'semantics.html#the-address-element', '<address>')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5 W3C', 'sections.html#the-address-element', '<address>')}}{{Spec2('HTML5 W3C')}}
{{SpecName('HTML4.01', 'struct/global.html#h-7.5.6', '<address>')}}{{Spec2('HTML4.01')}}
+ +

浏览器兼容性

+ + + +

{{Compat("html.elements.address")}}

+ +

另请参阅

+ + -- cgit v1.2.3-54-g00ecf