Sunday, March 9

Logical and Physical tag in HTML



A tag that is applied to an individual character is known as a character tag. A character tag can be grouped into two categories: physical and logical. (Note: physical styles are associated with physical character tags; logical styles are associated with logical character tags.)

As you work with these tags to style your text in different ways, you will discover that there is not really big difference how the text is displayed on a browser. For instance, you can italicize your text using the <i> tag (a physical character tag) or <em> tag (a logical character tag). Why does that make any difference? It depends on whether you are using italics for the sake of using italics or whether you are using italics to convey some special meaning. While a physical character tag controls how to format the text, a logical character tag describes how the text is being used, without regard to how it should be formatted. Thus a logical style would be used to convey some meaning while a physical style would not.


Physical Tags


Physical tags are used to indicate exactly how specific characters are to be formatted.
The syntax or format for using a PHYSICAL TAG is as follows:

<Tag Name> Characters to be formatted. </Tag Name>



HTML code
Output
This is <b>bold</b>
This is bold
This is <big>big font</big>
This is big font
This is <i>italic</i>
This is italic
Was <s>$50</s>; now $40
Was $50; now $40
This is <small>small</small>
This is small
H<sub>2</sub>O
H2O
 

Logical Tags


Logical tags are used to indicate to the visually impaired that there is some emphasizes on the text. Each browser has its own technique on how to indicate viewer that the text between the tags are different.
The syntax or format for using a LOGICAL TAG is as follows:

<Tag Name> Character/s to be formatted. </Tag Name>




HTML
OUTPUT
<code>y = m * x + b</code>
y = m * x + b
<del>Deleted</del> text
Deleted text
<dfn>definition</dfn> text
definition text
This is <em> emphasized </em>.
This is emphasized .
<ins>inserted</ins> text
inserted text



This Is The Oldest Page