News & UpdatesProgrammingWeb programming Store My Projects
Links
Affiliates

HTML Tutorial – 09 – Presentational Markup

The presentational markup is used to describe the appearance of text. However, it is recommended to use CSS instead for handling all kinds of style information.

First, there are the text styles: bold <b>, italic <i>, underlined <u> and strike-through <s> <strike>. Bold and italic are still commonly used text styles, but underlined and both strike-through tags have become deprecated. Like most other tags they all come in pairs and contain the text that they affect.

<b>bold</b>, <i>italic</i>, 
<u>underlined</u>, <s>strike-through</s>

These elements can be nested together to combine different text styles.

<b><i><u>combination</u></i></b>

The teletype element <tt> gives a fixed-width typeface, just as the preformatted tag.

<tt>teletype (monospaced) text</tt>

The <big> and <small> elements change the font size.

<small>small text</small>
<big>big text</big>

These elements can be nested several levels deep in order to achieve a greater effect.

<small><small>smaller text</small></small>,
<big><big>bigger text</big></big>

The <sup> and <sub> elements make text render as either superscript or subscript.

<sup>Superscript</sup>
<sub>Subscript</sub>

The font element can be used to specify color, size and typeface of text. The size can be a value from 1 to 7, or it can be specified relative to the current font size with a plus or minus sign before the number. By default the standard size is 3, so a font size of “+1” would equal a size of 4. The face attribute can contain one or more font names in a comma separated list. If the client’s computer does not have the first font it will then try to use the next one and so on.

<font color="#FF0000" size="4"
 face="Arial, Helvetica, sans-serif">Example text</font>

The body element provides a number of deprecated attributes for controlling the general appearance of the web page. The default text color can be changed using the text attribute. A background color can also be added, or a background image, which will be tiled in the background.

<body text="gold" bgcolor="#000000" background="pvt.png">
Recommended additional reading:
Sams - Teach Yourself HTML and CSS in 24 Hours