So let??™s now take
a look at the font properties.
Font-Style Property
Example: h2 {font-style:italic;}
Other values: normal, oblique
Font style determines whether a font is italicized or not. It??™s that
simple. If you want a piece of text to be italicized, you write this
p {font-style:italic;}
You can also write oblique instead of italic, but the result is the
same.
There are only two useful settings for the font-style property:
italic to make regular text italicized, and normal to make a section
within italicized type regular ???upright??? text. In this example,
p {font-style:italic;}
span {font-style:normal;}
This is italicized type with a piece of non-italic
text in the middle.
The code produces the result in Figure 3.10.
STYLIN??™ WITH CSS - CHAPTER 3 82
FIGURE 3.10 The normal value for
the font-style property causes a
speci?¬? ed section of text to appear
normal within a bit of italicized text.
Note on the Value Normal
normal causes any of the possible effects of a property not to be applied. Why might you want to do this? As I showed
you in the font-style example in the main text, setting font-style:normal leaves the text in its regular state, rather
than italicized. The reason this option is available is so you can selectively override a default or a global property you
have set. Headlines h1 through h6 are bold by default, so if you want to unbold the h3 element, for example, you need
to write h3 {font-weight:normal;}.
Pages:
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124