Prev NEXT

How Web Pages Work

Font Color and Size

Color

Change the color of any text by using the tags:

<字体颜色= "颜色" >…< / font >

Advertisement

This is blue.

This is green.

Most standard colors will work. Also try "lights" and "darks" such as "lightblue" or "darkgreen." You can also specify a particularhexadecimal colornumber, such as: . For a list of hexadecimal color codes, visitDecember.com: HTML.

If you would like to assign a specific color to the entire text of your page, add text="color" within the tag.

Example:

Even if you assign a color to your entire text, you can still change the color of any portion of that text by using the tags you learned above.

Font Type

Change the font type of any text by using the tags: ...

This is arial.

This is geneva.

(Note:If the font type you specify is not available in the user's computer, the font type will default to the browser default, usually Courier or Times New Roman; so it is best to stick to standard font types if you want to be able to control what is displayed in the user's browser.)

大小

Change the size of any text by using the tags:

...

Example:

The default font size on most browsers is "3", so any values larger than 3 will make the text larger, and any values smaller than 3 will make it smaller.

You can also change the font size by adding to or subtracting from the default font size.

Example: , or

This font is increased by 2

This font is increased by 1

This font is decreased by 2

This font is decreased by 1

You can also change the font size by using the tags and :

This is small text.

This is big text.

Headings

Heading tags also change font size, creating a bold "heading" for a paragraph or story:

This is an H1 heading.

This is an H2 heading.

This is an H3 heading.

End any font element change with the tag:

Or, by using the coordinating ending pair for the specific tag you used:

Example: , ,

In the next section, we'll find out how to add background color.