Beginner LevelHTML & Semantic Web
What is the correct semantic use case for the <address> element?
❓ Interview Prompt: Explain <address> semantic usage for document or article contact information vs physical locations.
The '<address>' HTML element provides contact information for its nearest '<article>' or '<body>' ancestor.
Valid Use Cases:
•
Email addresses, physical mailing addresses, phone numbers, or social media handles for the author/owner of the document or article.
Misuse:
Do NOT use '<address>' for arbitrary physical addresses mentioned in text (e.g. hotel addresses in a travel blog) unless it represents contact info for the article author!
Code Implementation Example
html
<article>
<h2>Written by Jane Doe</h2>
<address>
Contact the author at <a href="mailto:jane@example.com">jane@example.com</a><br>
Twitter: <a href="https://twitter.com/janedoe">@janedoe</a>
</address>
</article>💡Semantic use of address element for article author contact details.
🎯 Interview Key Takeaway
Use <address> specifically for contact information relating to the document or article author.
#address#Semantics#Contact Info#Beginner
Back to all HTML & Semantic Web Questions→