Open In App

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:

<address>
  Address content...
</address>




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

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






<!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 


Article Tags :