Quantcast
Channel: Envato Tuts+ Web Design
Viewing all articles
Browse latest Browse all 4333

HTML Element: address

$
0
0

The HTML <address> element represents the contact information for a person or organization associated with the document. It shouldn’t be used for arbitrary postal addresses.

Specifically, <address> is reserved for contact details connected with the nearest <article> or <body> ancestor, or the nearest <blockquote>, <figure>, or <td> ancestor in that order.

Syntax

The <address> element is an inline element and is written like this:

1
<address>
2
3
<!-- Contact information goes here -->
4
5
</address>

Example

Here’s an example of how you can use the <address> element to provide contact information for the author of an article:

1
<article>
2
<header>
3
<h1>My Awesome Article</h1>
4
<address>
5
      Written by Andy L.<br>
6
      Email: andy@web-crunch.com<br>
7
      Twitter: <ahref="https://twitter.com/webcrunchblog">@webcrunchblog</a>
8
</address>
9
</header>
10
<p>Lorem ipsum dolor sit amet...</p>
11
</article>

Result

Attributes

The <address> element has no specific attributes. However, it can be styled using global attributes, such as class or id.

Content

The content of the <address> element typically consists of contact information for the author or owner of a document, such as a name, email address, physical address, or phone number.

Did You Know?

  • The <address> element was introduced when the HTML 3 spec was drafted in 1995.
  • The <address> element is often combined with the <footer> element to provide additional information about the author or owner of a document.

“The address element is not appropriate for all postal and e-mail addresses; it should be reserved for providing such information about the contact people for the document.” — W3C HTML5 specification

Learn More


Viewing all articles
Browse latest Browse all 4333

Trending Articles