How to use <address> tag, doubts?

Asked

Viewed 2,618 times

6

It is correct to use the element <address> just for an email?

For example:

<address><a href="mailto:[email protected]">[email protected]</a></address>

Examples I always see are something like street address, city, etc..

Would there be some rule saying where I can or can’t add this element <address>, or can I put it anywhere I want? obg :)

1 answer

10


It is not wrong to put only one email, as this element serves to insert contact information about your page when used globally within the element <body> or about an author in cases where he is being used within the element <article>.

It can be used to inform from a simple contact email as in your case, as well as to inform a complete address of a physical location. Here are some examples below.

Simple example:

<footer>
  <address>
    <p><a href="http://www.w3.org/Consortium/contact-mit">MIT</a></p>
  </address>
</footer>

Example with address:

<footer>
  <address>
    <h5>Contate-nos</h5>
    <p> 
    Rua Leonardo Mathias, 100, Sala 30<br>
    Vila Roitman - Santos/SP, 11244-444 </p>
    <p>
      <abbr title="Phone">Tel:</abbr> (11) 5555-4577 
     </p>
  </address>
</footer>

Example with article:

<article>
  <header>
    <h1>The Very First Rule of Life</h1>
    <p><time pubdate datetime="2009-10-09T14:28-08:00"></time></p>    
  </header>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Numquam autem similique totam molestias dolorum, eius iusto cupiditate ex debitis fuga. Quaerat minima harum esse iste voluptates quod, magnam placeat sapiente.</p>
  <footer>
    <address>
  Written by <a href="mailto:[email protected]">Jon Doe</a>.<br>
  Visit us at:<br>
  Example.com<br>
  Box 564, Disneyland<br>
  USA
    </address> 
  </footer>
</article>

Normally this element is used within the element <footer>, but you can use it in other elements too, since it is being used for contact information, so it will not be wrong.

  • Got it, obg by the answer ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.