Skip to content
Related Articles

Related Articles

Physical and Logical Tags in HTML
  • Last Updated : 25 Feb, 2021

Physical and Logical tags are used in HTML for better visibility and understanding of the text by the user on the web page. However, both tags differ from each other as suggested by their names.

Logical Tags  :
Logical Tags are used in HTML to display the text according to the logical styles. Following are the Logical tags commonly used in HTML.

Logical Tags

TagDescription
<abbr>Defines an abbreviation
<acronym>Defines an acronym
<address>Defines an address element
<cite>Defines citation
<code>Defines computer code text
<blockquote>Defines a long quotation
<del>Defines text
<dfn>Defines a definition term
<ins>Defines inserted text
<kbd>Defines keyboard text
<pre>Defines preformatted text
<q>Defines short quotation
<samp>Defines sample computer code
<strong>Defines strong text
<var>Defines a variable

Sample Code using Logical Tags:

HTML




<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
  
<h1> Logical Tags </h1>
   
Welcome to <abbr title="GeeksforGeeks"> GFG</abbr> <br>
    
This is <acronym title="GeeksforGeeks">GFG</acronym> <br>
    
<address> GeeksforGeeks, 5th & 6th Floor, Royal Kapsons, A- 118, Sector- 136, Noida, 
Uttar Pradesh (201305) </address> <br>
    
<cite> GeeksforGeeks </cite> is my favourite website. <br>
    
<code> Sample code: system.out.println(); </code>
    
<blockquote cite="https://www.geeksforgeeks.org/">
A Computer Science portal for geeks. It contains well written, well thought and well 
explained computer science and programming articles, and quizzes.
</blockquote>
    
<del> This contains deleted content.</del>
    
<ins> Newly inserted content.</ins>
    
  
<p>
<dfn> GeeksforGeeks </dfn> is a Computer Science portal for geeks. It contains well 
written, well thought and well explained computer science and programming articles, 
and quizzes.
</p>
  
    
<kbd> GeeksforGeeks - This is a Keyboard input </kbd>
    
<pre>    Dear User,
  
    Congratulations !!
  
  
    We are delighted to inform you that you are going to be part of GfG journey.
  
  
  
    Thanks,
    GfG Team
  
  
This is a predefine formatted text </pre>  
    
</body>
</html>

Output:



Physical Tags 

Physical Tags are used in HTML to provide actual physical formatting to the text. Following are the Physical tags commonly used in HTML.

Physical Tags

TagDescription
<b>Defines bold text
<big>Defines big text
<i>Defines italic text
<small>Defines small text
<sup>Defines superscripted text
<sub>Defines subscripted text
<tt>Defines teletype text
<u>Deprecated. Use styles instead

Sample Code using Physical Tags:

HTML




<!DOCTYPE html>
<html>
<head>
<title>Physical Tags</title>
</head>
<body>
    
<h1> Physical Tags </h1>
Text without any formatting <br>
<b> GeeksforGeeks- This is Bold text </b> <br>
<big> GeeksforGeeks- This is BIG text </big> <br>
<i> GeeksforGeeks- This is Italic text </i> <br>
<small> GeeksforGeeks- This is Small text </small> <br>
1<sup>st </sup> <br>
H<sub>2</sub>O <br>
<tt> GeeksforGeeks- This is teletype text </tt> <br>
<u> GeeksforGeeks- This is underlined text</u> <br>
    
</body>
</html>

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :