News:

This week IPhone 15 Pro winner is karn
You can be too a winner! Become the top poster of the week and win valuable prizes.  More details are You are not allowed to view links. Register or Login 

Main Menu

Free HTML course - Physical tags

Started by ben2ong2, October 03, 2006, 05:47:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ben2ong2

Text in HTML code can be dressed up in various ways so that it's displayed differently by the browser. Text can be made Bold, Underlined, Italicized, Struck-through etc. Moreover, you can make text both italicized and bold at the same time.

There are many tags that perform such embellishments on text. These tags can be either Physical Tags or Logical Tags.

So what is the difference between these?
Physical tags define how the text should be displayed in the browser. They control the Physical characteristics of the text.
Logical Tags on the other hand indicate the 'type' of content they enclose. They do not determine the display of the text and the browser is free to set the presentation.
More on these differeneces in the next session.



Physical Tags
There are 10 physical tags each requiring a closing tag:

<I> Italics:   I am in italics
<B> Bold:   I am in bold
<U> Underline:   I am underlined
<STRIKE> Strikethrough:   I am struck!
<SUP> Superscript:   My superscript
<SUB> Subscript:   My subscript
<TT> Typewriter:   I am in typewriter form
<BIG> Bigger font:   I am bigger
<SMALL> Smaller font:   I am smaller
<S> Strikethrough alternative:   I am also struck!
Tag Nesting
Physical tags can be nested i.e. one tag can be placed (including its closing tag) inside another. Let's test this:

<B>Some text</B> displays Some text which is in bold

Give more emphasis by underlining this text:

<U><B>Some text</B></U> displays Some text which is bold and underlined

Still more emphasis:

<I><U><B>Some text</B></U></I> displays Some text which is bold, underlined and in italics.



Just remember to always put the end tag of the nested element before the end tag of the enclosing element. I advise you to develop the habit of putting the end tag the moment you open a tag. It's a good practice and will prevent headaches since HTML files with <TABLE>, <TR>, <TD> (discussed in Advanced HTML Tutorials) etc. can become quite confusing.



You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login