Page 94 - 2633 Trackpad Pro V5.1 Class 7
P. 94
FONT PROPERTIES
CSS font property is used to define the font, size and the style of the text. Some of the commonly
used font properties are font-family, font-style, font-size, etc.
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.
Syntax: FONT-FAMILY:Font1, Font2;
Let us create a web page to set font family.
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>CSS Font</TITLE>
</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>
FONT STYLE
The FONT-STYLE property in CSS is used to specify the style of a font, such as normal, italic, or
oblique.
FONT SIZE
The FONT-SIZE property is used to increase or decrease the size of a font. Syntax of Font Style and
Font Size:
<P STYLE="FONT-STYLE:ITALIC; FONT-SIZE: font size in px;">
TEXT
</P>
92 Premium Edition-VII

