Lesson 3C - Font/Basefont Tags

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 Times New Roman font face.
This is font size 5.
This is red font.
This is Times New Roman, size 4, purple font.

Now paste:

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:

This is the default font. This is Times New Roman font face, that is now font size 5, that is also orange color, until we take the color away and the size. Notice we are back to the default font.

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
<basefont>
By now, your sample.htm file should look like this.
Not all browsers recognize all fonts. For a list of Web-Safe fonts that will appear in all browsers, see this site.

Lesson 3B Depricated Block Tags   < <  PREVIOUS   Table of Contents NEXT  > >   Lesson 4A Horizontal Lines

Developed with HTML-Kit
Sandersongs Web Tutorials
Contact the Webmasterwith comments.
©2024, by Bill Sanders, all rights reserved.
This domain had 3,421 different visits in the last 30 days.
http://www.sandersongs.com/HTMLcourse/Lesson03C.php
This page was last modified on our server on 11 Jul 2021
and last refreshed on our server at 6:50 pm, UTC
This file took 0.00789 seconds to process.