HTML
HTML introduction
HTML basics
HTML text format 1
HTML text format 2
HTML text format 3
HTML links
HTML images
HTML image maps
HTML forms
Fieldset/legend tags
Email links
HTML labels
HTML tables
HTML frames
HTML backgrounds
HTML colors
HTML color shades
HTML color usage
HTML marquees
HTML fonts
HTML entities
HTML stylesheets
HTML layout
HTML div/span
HTML audio
HTML video
HTML objects
HTML d'load media
HTML meta tags
HTML scripts
HTML declarations
HTML head section
HTML document types
HTML tag rules
HTML things to avoid
URL formatting
Encoding and decoding
HTML use/access
HTML publish work
History of HTML
HTML summary

Programming

Programming intro
Java

Markup

First webpage guide
XHTML

Style & Layout

CSS

Browser scripting

Javascript
VBScript
AJAX

Server scripting

PHP
ASP

Making money online

Make money online

HTML text

Text in an HTML document can be manipulated in many ways such as changing the texts size, color, font type, and more.

This lesson focuses on:

Heading tags

Heading tags are used to denote text of different sizes. The lower the number in the tag, the bigger the text will be.

Heading tags:

<h1> - <h6> </h1> - </h6>

Example:

<h5>this text is small</h5>
<h3>this text is bigger</h3>
<h1>this text is the biggest</h1>

Output:

this text is small

this text is bigger

this text is the biggest

Making text bold, italic, and/or underlined

The <b> tag makes text bold, the <i> tag makes text italic, and the <u> tag underlines text.

Example:

<b>here is some bold text</b>
<br />
<i>here is some italic text</i>
<br />
<u>here is some underlined text</u>
<br />
<u><i><b>
here is some bold, italic, and underlined text
</b></i></u>

Output:

here is some bold text
here is some italic text
here is some underlined text
here is some bold, italic, and underlined text

The <font> tag

The <font> tag is used to set text size, font type, and color. It takes three attributes - size, face, color.

Example:

<font face="Comic Sans MS" color="green" size="5">
The font of this text will be Comic Sans MS, 
it will be green, and a size of 5.
</font>

Output:

The font of this text will be Comic Sans MS, it will be green, and a size of 5.

NOTE: The <font> tag is deprecated in HTML 4.01

Examples

Bold, italic, and underlined text
This example demonstrates displaying text as bold, italic, or underlined.

Headings
This example demonstrates displaying text in different sizes using headings.

See more HTML text examples

Exercises

Create a webpage that prints your name to the screen in green. [See solution]

Create a webpage that prints to the screen the numbers 1 - 10, each number being a different color. [See solution]

See more HTML text exercises

Practice

Online code editor
Practical examples
Practical exercises
Step-by-step tutorials

Reference

Terms glossary
Reference material

Rate this site

Rate this site
Visitor comments