How to use the address tag, doubts?

6

Is it correct to only use the element <address> for an email?

For example:

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

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

Would you have any rules telling me where I can or can not add this <address> element, or can I put it wherever I want? obg:)

    
asked by anonymous 18.07.2016 / 01:37

1 answer

9

It's not wrong to just put an email because this element is meant to insert contact information about your page when used globally within the <body> element or on an author in cases where it is being used within the element <article> .

It can be used to report 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>

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

    
18.07.2016 / 04:00