首页  >  文章  >  web前端  >  HTML 中的地址标签

HTML 中的地址标签

WBOY
WBOY原创
2024-09-04 16:30:55837浏览

HTML 文档的地址标签是符号化的,提供有关组织或个人的联系信息。 标签在 HTML 文档中的不同位置使用时具有不同的含义;当它在

中使用时标签,那么它将显示文档的联系信息,如果在
中使用它,那么它将显示文档的联系信息。 tag,那么它就代表了文章的联系方式。一般来说,由
表示的文本是:标签将以斜体显​​示。某些浏览器具有在地址标记前后添加换行符的功能。 标签可以在多种上下文中使用,例如通过包含来指示文章的作者。
中的元素在页眉中标记或提供企业的联系信息。

注意: HTML5 中的 Address 标签需要开始和结束标签,即

……..
  • 地址标签不能代表任意地址(即与联系信息无关的地址)。
  • 地址标签不应包含除联系信息以外的信息,例如发布日期(为此,请使用

语法

下面是提到的语法:

1。 HTML/XHTML

<body>
<footer> ... </footer>
<body>

2。 CSS

footer{
--your css code—
}

地址标签中的重要要点

下面提到了有关标签的一些要点:

  • 如果有的话,元素正式放置在
    内。当前部分的元素。
  • 之前,
    曾经是这样的情况。元素只能代表文档作者的联系信息。然而,它的定义在最新的规范版本中已经升级,因为它现在可以用于任意标记地址。
  • ;元素不应包含比联系信息更多的信息,例如发布日期(为此,请使用
  • 地址标签唯一允许的内容类型是流内容,意思是作为父标签,不能嵌套
    标签。元素;然后相同的内容不能有 标签作为其父级。
  • 大多数浏览器都会呈现
    内的文本斜体标签,但您可以通过 CSS 样式更改此行为。
  • 地址标签不能代表任意地址(例如邮政地址),除非这些地址是该部分的联系信息。要显示邮政地址,请使用

    标签。

  • ;标签不允许包含
  • 对于早于 IE 9 的 Internet Explorer 浏览器,请使用 HTML5,这是一种 JavaScript 解决方法,可为新的 HTML5 元素(例如
    、 、、

标签特定属性

不能使用特定属性标签。

1.全局属性

像所有其他 HTML 标签一样,

标签还支持HTML5中的全局属性。以下是全局属性:
  • 访问键
  • 班级
  • 内容可编辑
  • 上下文菜单
  • 目录
  • 可拖动
  • 降落区
  • 隐藏
  • id
  • 项目
  • itemprop
  • 项目参考
  • 项目范围
  • 项目类型
  • 拼写检查
  • 风格
  • 标签索引
  • 标题
  • 翻译

有关这些属性的完整说明,请访问 https://www.educba.com/html-attributes/。

2.事件属性

; HTML5 中的 tag 也支持所有事件属性。以下是以下事件处理程序内容属性。

  • onabort
  • oncancel
  • onblur
  • oncanplay
  • oncanplaythrough
  • onchange
  • onclick
  • oncontextmenu
  • ondblclick
  • ondrag
  • ondragend
  • ondragenter
  • ondragexit
  • ondragleave
  • ondragover
  • ondragstart
  • ondrop
  • ondurationchange
  • onemptied
  • onended
  • onerror
  • onfocus
  • onformchange
  • onforminput
  • oninput
  • oninvalid
  • onkeydown
  • onkeypress
  • onkeyup
  • onload
  • onloadeddata
  • onloadedmetadata
  • onloadstart
  • onmousedown
  • onmousemove
  • onmouseout
  • onmouseover
  • onmouseup
  • onmousewheel
  • onpause
  • onplay
  • onplaying
  • onprogress
  • onratechange
  • onreadystatechange
  • onscroll
  • onseeked
  • onseeking
  • onselect
  • onshow
  • onstalled
  • onsubmit
  • onsuspend
  • ontimeupdate
  • onvolumechange
  • onwaiting

For a full explanation of these attributes, visit  https://www.educba.com/html-event-attributes/

CSS text formatting properties in
tag

  • Text-color
  • Text-alignment
  • Text-decoration
  • Text-transformation
  • Line-height
  • Text-direction
  • Text-shadow
  • Word-spacing

CSS Font properties in
tag

  • font-style – normal|italic|oblique|initial|inherit
  • font-variant – normal|small-caps|initial|inherit
  • font-weight – normal|bold|bolder|lighter|number|initial|inherit
  • font-size – medium|xx-small|x-small|small|large|x-large|xx-large|smaller|larger|length|initial|inherit
  • font-family – family-name|generic-family|initial|inherit

CSS Test Shadow property for
tag

<style>
address{
text-shadow: 1px 1px #FF0000;
}
</style>

Note: If the footer contains contact details, put them in the

tag.

Examples of Address Tag in HTML

Below are the examples of Address Tag in HTML:

Example #1

Code:

<!DOCTYPE html>
<html>
<head> . . . </head>
<body>
<header>
<h1>HTML Address tag example</h1>
</header>
<main>
<article> An article on HTML Address tag</article>
</main>
<aside> Body of an article </aside>
<footer>
<section>Copyright &copy;2020- EDUCBA.</section>
<address> A- 406, Boomerang, Chandivali Farm Road,
Yadav Nagar, Chandivali, Powai,
Maharashtra, Mumbai - 400072. </address>
</footer>
</body>
</html>

Output:

HTML 中的地址标签

Example #2

Code:

<!DOCTYPE html>
<html>
<head> . . . </head>
<body>
<header>
<h1>HTML Address tag example</h1>
</header>
<div>
<address> A- 406, Boomerang, Chandivali Farm Road,
Yadav Nagar, Chandivali, Powai,
Maharashtra, Mumbai - 400072. </address>
</div>
</body>
</html>

Output:

HTML 中的地址标签

Example #3

Code:

<!DOCTYPE html>
<html>
<head> . . . </head>
<body>
<header>
<h1>HTML Address tag example</h1>
</header>
<div>
<address> We are always here to help. If you have a requirement / query about our services; email us at <a href="[email&#160;protected]">[email protected]</a> and we'll do our best to reply within 24 hours </address>
</div>
</body>
</html>

Output:

HTML 中的地址标签

Conclusion

Below are mentioned some of the main key points which you should remember from this topic:

  • The HTML
    element is always in the tag.
  • The HTML
    tag provides the contact information for the closest ancestor in HTML 4.01.
  • The HTML
    tag includes contact information for the closest
    or ancestor in HTML5.
  • The
    tag is usually placed inside the
    tag for the
    or .
  • Do not place the publication date inside the
    tag; use the
  • Most browsers will render the text within the
    tag in Italics, but you can change this behavior by CSS styling.

以上是HTML 中的地址标签的详细内容。更多信息请关注PHP中文网其他相关文章!

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
上一篇:HTML checkbox Tag下一篇:Area Tag in HTML