Page 44 - modular_v2.0_HTML&_CSS_Fb
P. 44
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>
Setting font family
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:
42
Touchpad MODULAR (Ver. 2.0)

