Why cursive font doesn't work
I am learning CSS. I tried to make the text italic. But the text is not in italics. What 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>
You cannot set italic using the CSS command called font-weight
.
Use instead font-style: italic
.
.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>
You gave the wrong property for ITALY . Try this property and specify the same value
.italic{
font-style:italic;
}
Italic is not a weight font (which determines how bold the text is). It's afont-style
Use font-style: italic;
instead.
font-weight
is responsible for courage and uses the number (100, 200, 300, ..., 900) to set it; "bold" is only a special value.
italic
is a property font-style
, not a font weight:
.italic{
font-style:italic;
}
what's wrong
try this:
.italic{font-style:italic;}