我正在学习CSS。我试图用斜体文字。但是文字不是斜体的。问题出在哪儿?
.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>
您不能使用称为的CSS命令设置斜体font-weight
。
尝试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>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句