How to markup postal address in HTML ?

In this article, we will learn how to markup postal addresses in HTML. In this, we will use the <address> tag to contain the contact detail on the web page. This can help in building information on location, email address, phone number, and URL. The text inside the <address> tag will display in italic format. Some browsers add a line break before and after the address element.

 Approach: HTML is a Markup language used to design web pages. It has so many tags which can be used for different purposes. So, for this, we can use the <address> tag. The <address> tag can be used to add contact information of any type. This tag can be used to store addresses. This tag was introduced in HTML3 and it still exists in HTML5.

Syntax:

  • Add <address> tag where you want to insert any address.
<address>
  Address content...
</address>
  • Now add your address inside <address> tag and also add <br> tag at the end of every row as shown below.

HTML




<address>
      Jalandhar <br> <!-- Added City -->
      Punjab <br> <!-- Added State -->
      India <br> <!-- Added Country -->
      Ph: 1234567890 <br> <!-- Added Phone -->
</address>


  • There are many ways to markup postal addresses in HTML and we have shown the easiest and simplest way to do this.

Example: In this example, we will add an address tag.

HTML




<!DOCTYPE html>
<html>
 
<body
  <h1>Address</h1>
  <!-- Added address tag -->
  <address>  
      <!-- Added address & <br> tag below-->
      Jalandhar<br>
      Punjab<br>
      India<br>
  </address
</body>
</html>


Output:

HTML address tag