Another tag that appears in many old web pages is the Font tag. Although there are newer ways to control fonts, you will find this tag in widespread use in existing web pages.
By itself, the Font tag does nothing, but when "face", "size" or "color" attributes are added, you could change the font-face, the size and color of the text that appears on the page. try it
Open sample.htm and paste the following:
<font face="Times New Roman">This is Times New Roman font face.</font><br> <font size="5">This is font size 5.</font><br> <font color="red">This is red font.</font><br> <font face="times new roman" size="4" color="purple">This is Times New Roman, size 4, purple font.</font><br>
It would appear:
This is font size 5.
This is red font.
This is Times New Roman, size 4, purple font.
This is the default font. <font face="Times New Roman">This is Times New Roman font face,<font size="5"> that is now font size 5,<font color="orange"> that is also orange color,</font> until we take the color away</font> and the size.</font> Notice we are back to the default font.
It would appear:
Font face can be any of the fonts on your computer. If you pick a font face that the viewer's computer does not have, it will revert to the default font face for that browser. Font sizes can be anything from 1 (very small) to 7 (very large). We will learn more about colors in Lesson 7.
The <basefont> tag sets the default values for face, size and color
for the page. You place it immediately after the <body> tag, and it has no end
tag. The attributes are the same as the <font> tag. For example:
<basefont size="4" face="courier" color="blue">
Note: this tag is depricated and will no longer work in the newest browsers. (It might not
work in yours.) It might not work in this
try it. But it is
good for you to know about regardless.
Use it on your page.
- In this lesson, we learned about these tags:
- <font> and </font>, and
Not all browsers recognize all fonts. For a list of Web-Safe fonts that will appear in all browsers, see this site.