- Face of Fonts:
<FONT FACE="Font Name Here">...</FONT>
You must insert font name in double quotes in above tag.
Example:
<HTML>
<HEAD>
<TITLE>Example Illustrating Font Manipulation</TITLE>
</HEAD>
<BODY>
<FONT FACE="ARIAL">This text is in ARIAL font</FONT><br>
<FONT FACE="IMPACT">This text is in IMPACT font</FONT><br>
</BODY>
</HTML>
In above example we have used Arial and Impact fonts while you can use any font you want.
Warning: Fonts will be displayed on your viewer only if specified font is installed on your computer. So
be careful while using new fonts. It's better to use native windows fonts in your pages. Windows is
used by about %95 of web surfers.
Alternatively you can use several font faces for each part of your text. In this way your browser
will try alternative fonts if it can not find primary font.
<FONT Face="Arial,HELVATICA">...</FONT>
- Changing Font Colours:
to change text
color. Look at this example:
<HTML>
<HEAD>
<TITLE>Example illustrating Font colour change </TITLE>
</HEAD>
<BODY>
<FONT COLOR="#FF0000">This text is in red color.</FONT><br>
<FONT COLOR="#00FF00">This text is in green color.</FONT><br>
<FONT COLOR="#0000FF">This text is in blue color.</FONT><br>
</BODY>
</HTML>
In above text different colors are used. You can change text color by changing color number. If
you don't remember how to specify color numbers return to previous lesson and review section on
"web page background color".
- Combining Font attributes:
have text with different colors, font faces and font sizes.
You can even use text styles with <FONT> tag by nesting style and font tags.
<B><I><FONT SIZE="5" FACE="IMPACT" COLOR="#00FF00">
How is this ?
</FONT></I></B>
2-10 Changing default font colors in a web page
Each browser has its own default settings for text color, link color, visited link color and active link
color.
Text color default is black. Links are usually blue. To change default settings for these values you
must use <BODY> tag with more parameters.
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF"
VLINK="#00FF00" ALINK="#FF0000">Some Text </BODY>
BGCOLOR: Web page background
TEXT: Text Color
LINK: Link Color
VLINK: Visited link
ALINK: Active link
This lesson included some of the most important techniques in html writing. Now you must be able
to use any kind of text in your web pages.
As remembering so much tags and parameters is difficult, you must use them repeatedly so that
you can remember them.
"No one becomes a programmer without programming"
Exercises:
1- Write a html page that uses lines with these styles in separate output lines:
italic and bold
italic and underlined
bold and underlined
2- Make a web page with a banner text on it. Our banner is made of characters in increasing sizes
to banner's middle and then decreasing size to its end. First character starts with the size 1,
middle character size is 7 and last character size is 1 again. Banner text is "mylonglongname".
3- Write a html page with 9 separate lines in different colors. State color of each line in its text.