Page 96 - Plus_V2.2_C7_Flipbook
P. 96
Output:
Setting font family
In the above web page:
The paragraph (<P>) element contains the text, and the style attribute is used to apply inline CSS.
The font-family property is set to a prioritized list of font families separated by commas. If the first
font (COSMO) is not available, the browser will attempt to use the next one in the list, and so on,
until it finds an available font.
If none of the specified fonts are available, the browser will use the default SERIF font.
Font Style
The ‘font-style’ property is mostly used to make the text ‘italic’.
Example: <P STYLE=“FONT-STYLE: NORMAL, ITALIC, OBLIQUE;”>
TEXT
</P>
Let us create a web page to set font style.
<!DOCTYPE html>
<HTML>
<HEAD>
<STYLE>
body {
font-family: Arial, sans-serif;
}
h1 {
color: #3345;
}
p {
font-style: italic;
}
</STYLE>
<TITLE>Font Style Example</TITLE>
</HEAD>
<BODY>
<H1>Font Style Example</H1>
<P>This is italic text.</P>
</BODY>
</HTML>
94 Premium Edition-VII

