注意: HTML5 中的 Address 標籤需要開始和結(jié)束標籤,即
……..- 地址標籤不能代表任意地址(即與聯(lián)絡(luò)資訊無關(guān)的地址)。
- 地址標籤不應(yīng)包含聯(lián)絡(luò)資訊以外的信息,例如發(fā)布日期(為此,請使用
文法
以下是提到的語法:
1。 HTML/XHTML
<body> <footer> ... </footer> <body>
2。 CSS
footer{ --your css code— }
地址標籤中的重要要點
下面提到了有關(guān)標籤的一些要點:
- 如果有的話,元素正式放置在
- 之前, 曾經(jīng)是這樣的情況。元素只能代表文檔作者的聯(lián)絡(luò)資訊。然而,它的定義在最新的規(guī)範(fàn)版本中已經(jīng)升級,因為它現(xiàn)在可以用於任意標記位址。
- ;元素不應(yīng)包含比聯(lián)絡(luò)資訊更多的信息,例如發(fā)布日期(為此,請使用
- 位址標籤唯一允許的內(nèi)容類型是流內(nèi)容,意思是作為父標籤,不能巢狀 標籤。元素;然後相同的內(nèi)容不能有 標籤作為其父級。
- 大多數(shù)瀏覽器都會呈現(xiàn) 內(nèi)的文字斜體標籤,但您可以透過 CSS 樣式變更此行為。
- 地址標籤不能代表任意地址(例如郵寄地址),除非這些地址是該部分的聯(lián)絡(luò)資訊。若要顯示郵寄地址,請使用
標籤。
- ;標籤不允許包含
、 - 對於早於IE 9 的Internet Explorer 瀏覽器,請使用HTML5,這是一種JavaScript 解決方法,可為新的HTML5 元素(例如
、 、 、 、 、、
標籤特定屬性
不能使用特定屬性標籤。2.事件屬性
; HTML5 中的 tag 也支援所有事件屬性。以下是以下事件處理程序內(nèi)容屬性。
- 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 ©2020- EDUCBA.</section> <address> A- 406, Boomerang, Chandivali Farm Road, Yadav Nagar, Chandivali, Powai, Maharashtra, Mumbai - 400072. </address> </footer> </body> </html>
Output:
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:
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 protected]">[email?protected]</a> and we'll do our best to reply within 24 hours </address> </div> </body> </html>
Output:
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
- 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.