HTML Tutorial
.
  Text Formatting Tags.
.
The ITALICS tag provides the means of italicising a piece of text. Add a third PARAGRAPH tag to your file containing the text shown on the right.
<P><I>"and what is the use of a book"</I>
,thought Alice, <I>"without pictures?"</I></P>
The BOLD tag surrounds a piece of text that we wish to embolden. Add the BOLD tag around the word Alice in the third paragraph as shown.
<P><I>"and what is the use of a book",</I>
thought <B>Alice</B>, <I>"without pictures?"</I><P>
Similarly, we can underline text by surrounding the text with the UNDERLINE tag. Add the UNDERLINE tag as shown.
<P><I>"and what is the use of a book",</I>
thought <B>Alice</B>, <I>"<U>without pictures?</U>"</I></P>
It is important to nest tags correctly.
Nested tags must not overlap.
<B><I>This is correct</I></B>
<B><I>This is incorrect</B></I>
The FONT tag is used to display text in a particular font. The browser will display a default font, usually Times New Roman, unless the font is changed using the FONT tag. The FONT tag has a number of attributes including SIZE, COLOR and FACE.
The FACE attribute takes as its value the name of the font to be displayed. The SIZE attribute takes a relative font size on a scale of 1 to 7 with the default size being 3. So the text that you have written so far is size 3.
The text size that is displayed on the screen depends on the users browser settings. In the browser window showing your web page, click the View menu, choose Text Size and change the setting to Smaller or Larger. Notice how the text on the screen changes.
Add the paragraph below to your file.
<P>So she was considering in her own mind <FONT FACE="arial" SIZE="2" COLOR="red"> (as well as she could for the hot day made her very sleepy)</FONT> whether to make a daisy chain, when suddenly a white rabbit with pink eyes ran close by her.</P>
The BASEFONT tag is used to set the font for the whole document. In other words, it replaces the default font and has the same FACE, SIZE and COLOR attributes as the FONT tag. The FONT tag takes precedence over the BASEFONT tag and so the attributes defined in a FONT tag override those in the BASEFONT.
The BASEFONT tag does not surround
the document. It is placed at the
beginning of the document and
has no end tag.
<BASEFONT FACE="verdana" SIZE="2">
Add the BASEFONT tag as shown after the opening BODY tag in your file.
The BREAK tag enables a line break to be placed after a piece of text. Normally the browser will wrap text to the screen and lines will break automatically at the end of the screen width. The BREAK tag forces a line break and, like the basefont, it has no end tag. Add the following code to your file.
<P>The Walrus and the Carpenter<BR>
Were walking close at hand<BR>
They wept like anything to see<BR>
Such quantities of sand.</P>
The HORIZONTAL RULE tag places a horizontal rule across the width of the page. This tag as attributes of SIZE WIDTH and ALIGN. The default width is 100% of the web page. When the width is set to less than 100%, the rule can be LEFT, CENTER or RIGHT aligned. The SIZE attribute defines the thickness of the rule in pixels with the default size being 2.
<HR WIDTH="50%" ALIGN="center">
Place a horizontal rule at the end of your page with the attributes shown.

<< Back                   Next >>
.