Reputation: 462
I am learning CSS. I tried to make some text italic. But the text are not going italic. Where is the problem?
.bold {
font-weight: bold;
}
.italic {
font-weight: italic;
}
<p>This is some text</p>
<p class="bold">This is some bold text</p>
<p class="italic">This is some italic text</p>
Upvotes: 5
Views: 11747
Reputation: 438
You Have Given Wrong Property for ITALIC,Try This property and give same value
.italic{
font-style:italic;
}
Upvotes: 3
Reputation: 14172
italic
is a font-style
property, not font weight:
.italic{
font-style:italic;
}
Upvotes: 3
Reputation: 19963
You can't set italics using a CSS command called font-weight
.
Try using font-style: italic
instead.
.bold {
font-weight: bold;
}
.italic {
font-style: italic;
}
<p>This is some text</p>
<p class="bold">This is some bold text</p>
<p class="italic">This is some italic text</p>
Upvotes: 13
Reputation: 592
Use font-style: italic;
instead.
font-weight
is responsible for boldness, and uses number (100, 200, 300,..., 900) to set it; "bold" is just a special value there.
Upvotes: 3
Reputation: 944445
Italic isn't a font weight (which determines how bold the text is). It's a font-style
Upvotes: 3