CHANGING FONT FACE, SIZE, TEXT COLOR IN HTML

This page contains instructions on How to change Font face, size, text color in HTML.Font is the different style of writing text in a document. HTML  renders an option to change the formatting of text. The <FONT>tag allows us to set the size, style and color of a short segment of text. With this facility we can beautify the text in a presentable manner.

FONT FACE

To change the typeface or name of the font,<FONT FACE>element is used. Type <FONT FACE=”before the text. Press the Spacebar key and then type the name of the font you want to use and close the quotes. E.g.,<FONT FACE=”ARIAL”> Type</FONT>after applying the font style. You can easily understand by these following programmes:-

                           <HTML>

                          <HEAD><TITLE>Changing Font Face</TITLE></HEAD>

                          <BODY>

                          <FONT FACE=”LUCIDA HANDWRITING”>

                          <P Align=”Center”>

                           Life is like a strong. Which tune are you singing?

                           </P></FONT><BR><BR>

                           <P Align=”Left”>

                           <FONT FACE=”BROOKLYN”>

                           Position, power, Money, or Popularity do not make a Man Great. </FONT>

                           </BODY></HTML>

FONT SIZE

It is used to change the size of the font to be displayed. Syntax: FONT SIZE=”?”>. You can specify font size using the numbers from 1 to 7 in place of ‘?’(question mark). The smallest font size is 1 and the largest is 7. Type <FONT SIZE=”3”> before the text whose size you want to increase. Then type </FONT>after changing the font size. You can easily understand these tag by the following programmes:- also read how to create HTML document

                             <HTML>

                             <HEAD>

                             <TITLE>Changing Font Size</TITLE>

                             </HEAD>

                             <BODY>

                             <FONT SIZE=”3”>

                             Prayer need not be long to be heard. It just needs to be from heart.

                             </FONT><BR><BR>

                            <FONT FACE=”Times New Roman” SIZE=”5”>

                            If you want to be a <B>winner</B>, you have to be willing to give it your all.

                            </FONT>

                            </BODY>

                            </HTML>

FONT COLOR

The color attribute changes the color of the text. The color can be set by specifying the name of the color and also by giving color codes. The <FONT COLOR=”?”>before the text and replace ‘?’ with the name or color code you want to apply on the text. You can easily understand by these following programmes:-

                             <HTML>

                             <HEAD>

                             <TITLE>Changing Font Color</TITLE>

                             </HEAD>

                             <BODY>

                             <FONT COLOR=”RED”>

                             Give love today. Love your family. Love God. He will see to it that you have                                            sufficient

                              Love, and give you more in return that you can ever give away.

                             </FONT FACE=”Times New Roman” SIZE=”5”COLOR=”#800080”>

                             Before you judge others, think of your own last mistake.

                             </FONT>

                             </BODY>

                              </HTML> 

BASEFONT

<BASEFONT>tag is used to set Font, Size, Color and other attributes of the whole world HTML document. Its attributes are similar to <FONT>tag.

To set font size we have to just give a value from 1 to 7 to the size attributes.

<BASEFONT Size=4>

Not only this whenever we want to change font size for any particular line or paragraph, we can change it by adding or subtracting some value to the font size we have set initially. +/-1 in the value brings about an approximately 20% change to the original size.

<FONT size=+2> This will set font size 4+2=6

<FONT size=-3>  This will set font size 4-3=1

Here you can easily understand these attributes by following programmes:-

                                       <HTML>

                                       <HEAD><TITLE>BASEFONT</TITLE></HEAD><BODY>

                                       <BASEFONT FACE="Tahoma" size=4>

                                       This line has font size 4<BR>

                                       <FONT size=+2>

                                       Font size for this line is 6(BASEFONT size+2)<BR>

                                       <FONT size=-2>

                                       Font size for this line is 2(BASEFONT size-2)<BR>

                                       </BODY></HTML>

 Now lets see some important points regarding HTML attributes:-The <base>tag is placed inside the head element and is used to specify a default address for all links on the page.  I hope this information is useful for you. At last I want to give you a question try it and don't forget to answer in comment box.

Q.- What is the function of <PRE>tag?