HTML-FONT
TODAY I’II DISCUSS ABOUT HTML FONT TAG. FONT TAG DISPLAYS THE TEXT’S FONT FACE i.e. WHICH TYPE OF FONT IS USED TO DISPLAY
THE TEXT; IT ALSO DISPLAYS THE TEXT COLOUR AND
ALSO DISPLAYS THE TEXT’S SIZE. FONT IS A CLOSED
TAG.
FIRST OF ALL I’II DISCUSS ABOUT
DIFFERENT FONT SIZE OF A TEXT.
SYNTAX: <FONT
SIZE= “…. “> ……………….<\FONT>
SIZE GENERALLY IS 1 TO 7.
EXAMPLE:-
CODING:-
<!DOCTYPE html>
<html>
<head>
<title>DIFFERENT FONT
SIZE</title>
</head>
<body BGCOLOR="ORANGE">
<BR><BR><BR><BR><BR><BR>
<CENTER><B>
<font size
=1> IT IS THE EXAMPLE OF FONT SIZE 1 </font>
<br>
<font size
=2> IT IS THE EXAMPLE OF FONT SIZE 2 </font>
<br>
<font size
=3> IT IS THE EXAMPLE OF FONT SIZE 3 </font>
<br>
<font size
=4> IT IS THE EXAMPLE OF FONT SIZE 4 </font>
<br>
<font size
=5> IT IS THE EXAMPLE OF FONT SIZE 5 </font>
<br>
<font size
=6> IT IS THE EXAMPLE OF FONT SIZE 6 </font>
<br>
<font size
=7> IT IS THE EXAMPLE OF FONT SIZE 7 </font>
<br>
</B> </CENTER>
</body>
</html>
RESULT:-
IN THE ABOVE EXAMPLE DIFFERENT FONT
SIZES FROM 1 TO 7 ARE DISPLAYED.
+ AND - FONT SIZE:-
RELATIVE FONT SIZES CAN BE CREATED
USING + AND – BEFORE
NUMBER VALUE OF SIZE ATTRIBUTE OF FONT TAG. IT WILL DISPLAY THE LARGER OR SMALLER THAN
THE PRESET FONT SIZE.
SYNTAX:- <FONT SIZE= “+ ……..”>………………….
</FONT>
<FONT SIZE= “- ……..”> …………………
</FONT>
AS FOR EXAMPLE:-
CODING:-
<!DOCTYPE html>
<html>
<head>
<title>Relative Font
Size</title>
</head>
<body BGCOLOR="BLACK">
<BR><BR><BR><BR><BR><BR><BR><BR>
<CENTER>
<font color="red"> <font size ="-1"> IT IS THE FONT SIZE
OF MINUS ONE</font><br>
<font color="orange"> <font size ="+1"> IT IS THE FONT SIZE
OF PLUS ONE</font><br>
<font color="cyan"> <font size ="+2"> IT IS THE FONT SIZE
OF PLUS TWO</font><br>
<font color="purple"> <font size ="+3"> IT IS THE FONT SIZE
OF PLUS THREE</font><br>
<font color="pink"> <font size ="+4"> IT IS THE FONT SIZE
OF PLUS FOUR</font><BR>
<font color="AQUA"> <font size ="+5"> IT IS THE FONT SIZE
OF PLUS FIVE</font><BR>
</CENTER>
</body>
</html>
RESULT:-
FACE ATTRIBUTE OF FONT TAG:-
DIFFERENT FONT FACE CAN BE SET
USING FACE ATTRIBUTE OF FONT TAG, BUT INTHAT CASE MENTIONED FONT MUST BE
INSTALLED OTHERWISE DEFAULT FONT WILL BE DISPLAYED.
SYNTAX:- <FONT
FACE=”….”> ……… </FONT>
EXAMPLE:-
CODING:-
<!DOCTYPE html>
<html>
<head>
<title>FACE ATTRIBUTE OF FONT TAG</title>
</head>
<body BGCOLOR="PINK">
<BR><BR><BR><BR><BR><BR><BR><BR>
<CENTER>
<font FACE="Times
New Roman" color="BLUE" size =7>IT IS TIMES NEW ROMAN
FACE</font><br>
<font FACE="Verdana"
color="orange" size =7>IT IS VERDANA FACE</font><br>
<font FACE="Arial
Black" color="cyan" size =7>IT IS ARIAL BLACK
FACE</font><br>
<font FACE="Britannic
Bold" color="purple" size =7>IT IS BRITANNIC BOLD
FACE</font><br>
<font FACE="Algerian"
color="GREEN" size =7>IT IS ALGERIAN FACE</font><BR>
<font FACE="Castellar" color="RED" size =7>IT IS
CASTELLAR FACE</font><BR>
</CENTER>
</body>
</html>
RESULT:-
IN THE ABOVE EXAMPLE DIFFERENT FACES OF THE FONT TAG ARE DISPLAYED.
COLOR ATTRIBUTE OF FONT TAG:-
ANY FONT COLOUR CAN BE SET TO A
TEXT USING COLOR ATTRIBUTE OF THE FONT TAG.
COLOR ATTRIBUTE TAKES COLOUR NAME OR HEXADECIMAL
CODE OF A COLOUR AS ITS VALUE.
SYNTAX:- <FONT
COLOR=”…”> ……………… </FONT>
EXAMPLE:-
CODING:-
<!DOCTYPE html>
<html>
<head>
<title>COLOR ATTRIBUTE OF FONT
TAG</title>
</head>
<body BGCOLOR="OLIVE">
<BR><BR><BR><BR><BR><BR><BR><BR>
<CENTER>
<font
color="BLUE" size =7>IT IS
BLUE COLOR TEXE</font><br>
<font
color="orange" size =7>IT IS
ORANGE COLOR TEXT</font><br>
<font
color="#FF00FF" size =7>IT
IS HEXADECIMAL CODE OF A COLOR</font><br>
<font
color="purple" size =7>IT IS
PURPLE COLOR TEXT</font><br>
<font
color="PINK" size =7>IT IS
PINK COLOR TEXT</font><BR>
<font
color="RED" size =7>IT IS
RED COLOTR TEXT </font><BR>
</CENTER>
</body>
</html>
RESULT:-
IN THE ABOVE EXAMPLE DIFFERENT
COLOURED TEXTS USING NAME AND HEXADECIMAL CODE ARE SHOWN.
IN THE NEXT SECTION OF MY BLOG I’II
DISCUSS ABOUT OTHER IMPORTANT TAGS OF HTML.
…………………………………………………………
No comments:
Post a Comment