Things You'll Need:
- Text file editor
-
Step 1
Open up the web page you want to edit, then place the cursor in the place where you need to set text to a different font.
-
Step 2
Type the following:
-
Step 3
Type the text you want to appear with these attributes.
-
Step 4
Type the following right after the last character of your citation:
-
Step 5
Notice that your text now appears in red, 12-point Arial font. To change the text to your preferred style, simply replace the font size, color and font name with the appropriate entries.
-
Step 1
Add the following attribute to the element, such as
or, containing the text whose font you want to change:style="font-family: serif;"Step 2Replace
sans-serifwith the name of the font family you want, such assans-serif, a specific font name such asArial, or a list of font names separated by commas.Step 3Give the containing element a
classattribute, and define CSS properties for that class in thesection of the web page, or in a CSS file it includes. This is an alternative to using thestyleattribute. The format of such a declaration is:.class-name {font-family; sans-serif; }Tips & Warnings- Don't forget to close your font tag, or all your subsequent text will take be set to the same attributes.
- Though the font tag has not been phased out, better formatting effects can be achieved if you learn how to use a tool known as style sheets.
eHow Article: How to Set Text Font in HTML








