在 HTML 中设置字体的粗细和字形可以通过 CSS 的 font-weight 和 font-style 属性来实现。
p { font-weight: bold; }
p { font-style: italic; }
可以同时使用这两个属性来设置字体的粗细和字形,例如:
p { font-weight: bold; font-style: italic; }
这样就可以将段落设置为加粗斜体字体。