如何在HTML元素中用CSS定义特定字词?

问题描述:

如何设置< p> 标签中的特定字词样式?
EX: STUDIO X 是最好的工作室。

How do I style a specific word within <p> tags? EX: STUDIO X is the best studio ever.

^^我如何使用css,

^^How do I, using css, make "STUDIO X" a different font than "is the best studio ever?"

您应该这样做:

HTML

<p>
    <span>STUDIO X</span> is the best studio ever
</p>

CSS

p {
font-size:12px;
}
    span {
    font-size:16px;
    font-weight:bold;
    }



我建议您为< ; p> < span> 标签,才能防止意外覆盖。

I recommend you to define a specific class for <p> and <span> tags, it will prevent unexpected overwrites.