News:

This week IPhone 15 Pro winner is karn
You can be too a winner! Become the top poster of the week and win valuable prizes.  More details are You are not allowed to view links. Register or Login 

Main Menu

HTML kit - Text Controlling Tags Part 3

Started by ben2ong2, October 03, 2006, 06:00:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ben2ong2

It is now time to add a bit of spice to the otherwise dry text you have been used to till now. Various properties of text can be changed using the <FONT> tag. Font type, size and color can be modified using the appropriate attribute of this tag.

I shall be discussing the following:

FACE: It's value/s specifies the font type.
COLOR: Changes the color.
SIZE: Changes Size.


FACE
Face attribute takes the name of the font you want to use. Common fonts on the Windows system are Verdana, Arial, Times New Roman and Comic Sans MS.

<FONT FACE="Times New Roman">This should be displayed in Times New Roman</FONT>

<FONT FACE="Arial">This should be displayed in Arial</FONT>

<FONT FACE="Verdana">This should be displayed in Verdana</FONT>

<FONT FACE="Comic Sans MS">This should be displayed in Comic Sans MS</FONT>

IMPORTANT: If you do not have the font installed in your system, the text will be displayed in the default font of your browser

After reading the 'IMPORTANT' message above, you might be thinking... "What's the use of changing the font when I don't know what fonts are installed on the visitor's computer?".
Ha! Well my friend, HTML developers provide us with solution to this problem.

Let's suppose you want the text to be displayed in a Sans-serif font. (These are fonts whose ends are blunt as opposed to serifed fonts that have strokes, flares or taperings at the ends). The common Sans-serif fonts on Windows are Arial, Verdana, Comic Sans MS. Since you do not know which of these is installed on the visitor's computer, include all in the attribute!

<FONT FACE="Arial, Verdana, Comic Sans MS, Sans-serif">



This tells the browser to use Arial and if it is not present, use Verdana, or if that is missing too, use Comic Sans MS. If the browser cannot find any of these fonts (highly unlikely, on a Windows system), it should just use any Sans-serif font available.
Be sure to spell the font name correctly.



COLOR
The attribute takes either the hexadecimal color value or just the color name. We shall leave the (lengthy) discussions on hexadecimal values for later and use color names here. Some common color names are Blue, Green, Red, Yellow, White, Black, Cyan, Magenta, Pink etc.

<FONT COLOR="RED">Red Text</FONT>

<FONT COLOR="BLUE">Blue Text</FONT>

<FONT COLOR="GREEN">Green Text</FONT>



SIZE
The size attribute takes a number from 1 to 7 as its value with 1 as the smallest and 3 the default.

<FONT SIZE="1">Some Text</FONT>

<FONT SIZE="2">Some Text</FONT>

<FONT SIZE="3">Some Text</FONT>

<FONT SIZE="4">Some Text</FONT>

<FONT SIZE="5">Some Text</FONT>


Also, you can use relative values, + and -, for increasing or decreasing font size relative to the current size. For increasing relative font size use values +1 to +6 and for decreasing use -1 to -6.



You are not allowed to view links. Register or Login
You are not allowed to view links. Register or Login