Open In App

Physical and Logical Tags in HTML

Improve
Improve
Like Article
Like
Save
Share
Report

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

Tag Description
<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

Tag Description
<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:



Last Updated : 25 Feb, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads