Lesson 2: Formatting Text
  1. Headers
  2. Font Container
  3. Bold Container
  1. Italics Container
  2. Underline Container

Headers (<H1>. . .</H1>, <H2>. . .</H2>, <H3>. . .</H3>, <H4>. . .</H4>, <H5>. . .</H5>, <H6>. . .</H6>)

What we commonly refer to as a heading is called a header in HTML. Headers are used to set apart document or section titles, such as the "Text Formatting" and "Headers" titles that you see above. It is important to note that these headers go into the body of your document, and are not the same as the HEAD tag mentioned in a previous section.

Headers begin at the margin of a line and always force line breaks at the end of the header. You cannot, therefor, have two header levels on the same line or highlight text in a paragraph by marking it as a header. Doing so will split the paragraph.

There are six levels of headers, numbered H1 through H6. Browsers will, by default, display all six header levels in the same font, with point size decreasing from H1 to H6. Here are all six header pairs:

The Header Containers
Syntax
Result
  • <H1>Hello</H1>
  • <H2>Hello</H2>
  • <H3>Hello</H3>
  • <H4>Hello</H4>
  • <H5>Hello</H5>
  • <H6>Hello</H6>

Hello

Hello

Hello

Hello

Hello
Hello

Top of Page


Font Container (<FONT>. . .</FONT>)

The FONT container is used to change size. The browser will display text in a default point size unless otherwise specified. Specifying SIZE="4", for example, changes font size to 4 points. Following is the HTML syntax to change font size:

The FONT Container
Syntax
Result
  • <FONT SIZE="4">Hello</FONT>
Hello

Top of Page


Bold Container (<B>. . .</B>)

The B tag displays the enclosed text in boldface type:

The Bold Container
Syntax
Result
  • <B>Hello</B>
Hello

Top of Page



Italics Container (<I>. . .</I>)

The I tag italicizes the enclosed text:

The Italics Container
Syntax
Result
  • <I>Hello</I>
Hello

Top of Page


Underline Container (<U>. . .</U>)

The U container underlines the enclosed text:

The Underline Container
Syntax
Result
  • <U>Hello</U>
Hello

NOTE: Since users may confuse underlined text with hypertext (typically underlined), the U tag should generally be avoided.

Top of Page


Previous
Next

 

| Home | Lesson 1 | Lesson 2 | Lesson 3 | Lesson 4 | Lesson 5 | FAQS |