Page 95 - Plus_V2.2_C7_Flipbook
P. 95
Let’s CatCh uP
Which property is used to align the text?
___________________________________________________________________________________
___________________________________________________________________________________
CSS FONT
CSS font property is used to define the font, size and the style of the text. Some of the commonly used
font properties are.
Property Value
font-family Times New Roman, Serif
font-style normal, italic, oblique
font-size 20px
font-weight normal, bold, 1-1000
Font Family
The font-family property is used to change the face of the font. The font family property works on the
principle of “fallback” system i.e. if the web browser is not compatible with the first font, it tries the
next font, and so on. If the name of a font family is more than one word, it must be in quotation marks,
like: “Times New Roman”. More than one font family can be specified in a comma-separated list.
Example: <P STYLE="FONT-FAMILY:Font1, Font2,………,SERIF;">
TEXT
</P>
Let us create a web page to set font family.
<!DOCTYPE html>
<HTML>
<HEAD>
</HEAD>
<BODY>
<P STYLE="FONT-FAMILY:COSMO, VERDANA, TIMES, SERIF;">
THIS TEXT IS RENDERED IN EITHER COSMO, VERDANA
TIMES, OR THE DEFAULT SERIF FONT DEPENDING ON
THE AVAILABILITY OF FONT IN THE SYSTEM.
</P>
</BODY>
</HTML>
Using CSS in HTML5 93

