gpt4 book ai didi

html - 为什么斜体字体不起作用

转载 作者:太空狗 更新时间:2023-10-29 16:49:00 26 4
gpt4 key购买 nike

我正在学习 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>

最佳答案

您不能使用名为 font-weight 的 CSS 命令设置斜体。

尝试使用 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>

关于html - 为什么斜体字体不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29704336/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com