Quick Reach
The font style property
The font-style property is used to make the text italic or oblique in the web pages. The default value of the font style property is normal.
See an example of font-style property
Syntax of font style
Following is the syntax of the CSS font-style property:
font-style: italic;
Where you can use the following values in the font-style property:
- italic
- oblique
- normal (default value)
Example of using font-style property
The example below demonstrates using the font style CSS property.
First heading (h1) is using the default value. The Heading 2 is assigned to use Italic while the Paragraph is using the oblique value in the font-style property.
Experience this example online
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
<html>
<head>
<style>
/*Using CSS font*/
h1
{
font-family:Verdana, Arial;
font-weight:bold;
font-size:25px;
}
h2
{
font-family:"Times New Roman", Arial;
font-weight:600;
font-size:20px;
font-style:italic;
}
p
{
font-family:Arial, Verana;
font-weight:normal;
font-size:15px;
font-style:oblique;
}
</style>
</head>
<body>
<h1>This is heading 1 with normal font style!</h1>
<h2>This is Heading 2 with italic font style</h2>
<p>This is Paragraph with oblique font style</p>
</body>
</html>
|
Further: CSS font-weight to make text bold
Leave A Comment?