Physical and Logical Tags in HTML
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 = "w3wiki" > GFG</ abbr > < br > This is < acronym title = "w3wiki" >GFG</ acronym > < br > < address > w3wiki, 5th & 6th Floor, Royal Kapsons, A- 118, Sector- 136, Noida, Uttar Pradesh (201305) </ address > < br > < cite > w3wiki </ cite > is my favourite website. < br > < code > Sample code: system.out.println(); </ code > A Computer Science portal for Beginner. 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 > w3wiki </ dfn > is a Computer Science portal for Beginner. It contains well written, well thought and well explained computer science and programming articles, and quizzes. </ p > < kbd > w3wiki - 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 > w3wiki- This is Bold text </ b > < br > < big > w3wiki- This is BIG text </ big > < br > < i > w3wiki- This is Italic text </ i > < br > < small > w3wiki- This is Small text </ small > < br > 1< sup >st </ sup > < br > H< sub >2</ sub >O < br > < tt > w3wiki- This is teletype text </ tt > < br > < u > w3wiki- This is underlined text</ u > < br > </ body > </ html > |
Output:
Contact Us