Quick Reach
Font Style
The Font style property is used to make the HTML text italic or oblique. The default value is normal. This is a CSS property that you can use in CSS block inside the <head> tag, inline CSS (style attribute of the element) or external CSS file.
Font style property example
The example below shows how to use the font-style property. The first heading (h1) is using the default value. The heading 2 is assigned to use Italic font style. While the paragraph is using oblique value.
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
64
65
|
<!DOCTYPE html>
<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 style!</h1>
<h2>This is Heading 2 with italic style</h2>
<p>This is Paragraph with oblique style</p>
</body>
</html>
|
Also see Complete HTML font guide
Leave A Comment?