HTML has a lot of ways built into it for formatting text. Bold, italic, typeface, color, and size are just a few.

When HTML was built, it was intended to be a way of displaying information and its builders didn't care about design. They let individuals set their browsers the way they preferred, specifying typeface and colors.

So there are tags to format text based either on the physical style, or on the logical place the text has.

Physical tags include:

BOLD:
<b> is a container tag, which takes no attributes, and can contain other style tags.</b>
ITALIC:
<i> is a container tag, which takes no attributes, and can contain other style tags.</i>
STRIKEOUT:
<s> is a container tag, which takes no attributes, and can contain other style tags.</s>
TYPEWRITER TEXT:
<tt> is a container tag, which takes no attributes, and can contain other style tags.</tt>
UNDERLINE:
<u> is a container tag, which takes no attributes, and can contain other style tags.</u> Not used very much, since hyperlinks are designated by underline.
FONT:
<FONT> is a container tag used to control a bunch of specific aspects of the text, and can take any or all of the following attributes. When using the FONT tag, you can combine the attributes in any order, and nest tags.
FACE:
Controls the typeface, and can take more than one value contained within quotation marks and separated by commas. The specific typeface must be available on the viewers computer. For example: <FONT FACE="Arial, Helvetica, Times New Roman">. If Arial is available, that's what the browser will use, if not it will go on to Helvetica, and so on.
COLOR:
Controls the color of the text, expressed in hexadecimal (just like BGCOLOR) and overrides the TEXT color specified in the BODY tag.
SIZE:
Controls the size of the text, and can be expressed either in absolute terms ranging from 1 (the smallest) to 7 (the largest) or relative to the current size using + and -.

The FONT tag is being used less and less, as more people switch over to using CSS (which we'll go into later).

Logical tags are more slippery, since different browsers implement them in different ways. These are the only one's that you'll ever actually use.

EMPHASIS:
<em> is a container tag, which takes no attributes, and can contain other style tags. Usually displayed as italics.</em>
STRONG:
<strong> is a container tag, which takes no attributes, and can contain other style tags. Usually displayed as bold.</strong>



Open this file (nine.html) in WordPad and play around with the text, adding and changing attributes to see how they look.



previous next contents