我正在尝试使用谷歌字体和斜体,但它根本不起作用。 我将这一行包含在我的 HTML 中。
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,300,400'
rel='stylesheet' type='text/css'>
例如,当我使用下面的代码时,所有文本看起来都“正常”,没有预期的粗体和斜体。有什么建议么?
谢谢。
<p>this is a <b>bold</b> text and this is <i>italic</i> text</p>
最佳答案
根据其instructions使用字体(除非您非常了解字体的工作原理并且可以故意偏离说明)。在界面中,如果您只想要普通、斜体和粗体(但不是斜体粗体),请选择普通(默认选择)、普通斜体和粗体。然后 Google 会告诉您要使用的 link
元素。它有效:
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700'
rel='stylesheet' type='text/css'>
<style>
p { font-family: Open Sans }
</style>
<p>this is a <b>bold</b> text and this is <i>italic</i> text</p>
关于css - 在谷歌字体中使用粗体和斜体标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27424696/