<B>
,
<I>
, <STRONG>
, <BLOCKQUOTE>
and <BR>
tags, for example). Now we'll look at ways to control your text more closely, including such aspects as
size, style, font and color.
NOTE: It is being increasingly recommended that you control the appearance of your page with style sheets, and use HTML tags to describe the structure and content of your text. However, many browsers still in common use do not properly support style sheets, and in many cases you must still include HTML commands in your code as an alternative. This may be expected to change within the next year or two. |
<BIG>
and </BIG>
tags will display one size (whatever
that means!) larger than the default size. Text between <SMALL>
and
</SMALL>
tags will display one size smaller than the default size.
WARNING: The default size of text (i.e., the size of text without any special sizing commands) is set by the user via the preference settings in their browser. Although you can override this, you shouldn't ever do it; the user may have very good reasons (such as video resolution, monitor size, or even visual disability) for choosing the setting they've established. |
<FONT>
and
</FONT>
tags. One of the attributes of the <FONT>
tag is
SIZE
. You specify SIZE
as a positive or minus whole number. For example,
<FONT SIZE="2">
means to display text two sizes larger than the default,
and <FONT SIZE="-3">
means display text three sizes smaller than the
default. Note that the actual difference between these various sizes is still not under your
control and is determined by the individual browser.
SIZE
attribute to specify the exact size in points, just
as you do in a word processor, but you should never do this, for the same reason as not
changing the default text size. 14 point text might look large to you, but it might be unreadably
small to someone running at very high resolution or with a visual disability. (In fact, it might well be
smaller than that user's default text size.) Many users will immediately
click away from a page that is obviously overriding their own preferences for the default text size.
NOTE: Although you can use the heading tags (<H1> , etc.) to set
relative text sizes,
this is not a good idea unless the text you're enclosing is actually a heading in the sense of
representing one of the topics of the page. See the earlier lesson on
Structure vs. Appearance for a more detailed explanation of this.
|
<U>
and
</U>
tags, but quite frankly underlined text is considered pretty passé
these days. Besides, it may confuse users who assume that underlined text is a link.
<EM>
and
</EM>
tags or <STRONG>
and
</STRONG>
tags instead. Most commonly EMphasized text is rendered in italics and
STRONG text in bold. However, this isn't required by the HTML standard, which means a browser could
display these tags differently, so if what you really want is definitely bold or italics
then use the <B>
and <I>
tags.
FACE
attribute
of the <FONT>
tag you can specify any typeface you want, such as Algerian,
like this:<FONT FACE="Algerian">
<FONT FACE="Algerian" SIZE="+2">Hi! I am displaying in Algerian</FONT>
FACE
attribute, and the user's browser will display the selected
text in the first of those fonts that it finds. For example, if we change our example to this:<FONT FACE="Algerian, Times New Roman, Times, serif" SIZE="+2">Hi! I might
be displaying in Algerian if you're lucky</FONT>
<IMG SRC="algerian.gif">
<FONT>
tag.
This time the attribute to use is COLOR
(duh). You specify color in the same way you
specify a background color, using either a recognized keyword or a hexadecimal code. And the same
warnings apply: don't use non-standard keywords, and if possible stick to Web-safe colors.
<FONT COLOR="PURPLE" SIZE="+1">Purple</FONT> and <FONT COLOR="#00CCCC" SIZE="+1">Turquoise</FONT> text.
Terms to know from this lesson |
<BIG> and </BIG> tags: Enclose
text to be displayed "one size" larger than default text. (How much larger constitutes "one size" depends on
the browser). |
<SMALL> and </SMALL> tags: Enclose
text to be displayed "one size" smaller than default text. (Again, how much
smaller constitutes "one size" depends on
the browser). |
<U> and </U> tags: Enclose
text to be underlined. |
<EM> and </EM> tags: Enclose
text to be emphasized. Typically text enclosed by these tags displays in italics, but not always. |
<FONT> and </FONT> tags: Enclose
text whose displayed characteristics will be varied in some way. |
SIZE attribute: In the <FONT> tag, used
to set the size of displayed text, either in relative or absolute terms. |
FACE attribute: In the <FONT> tag, used
to set the actual font (typeface) displayed. A series of fonts can be specified, and the browser will use
the first available one. |
COLOR attribute: In the <FONT> tag, used
to set the color in which the enclosed text displays, using either a recognized color keyword or a
hexadecimal value. |