我正在尝试将字体“Open Sans”应用于我的网站。我想在未加粗的文本中使用“Open Sans Regular”字体,在加粗的文本中使用“Open Sans Bold”字体,在斜体文本中使用“Open Sans Italic”字体,最后,在加粗且斜体的文本中使用“Open Sans Bold Italic”字体。我不想设置类别,而是希望它们适用于整个网站。
以下是我尝试过的代码,但它只将“Open Sans Italic”和“Open Sans Bold Italic”应用于所有内容,即使它不应该是斜体的时候:
这是一个问题的例子,注意所有字体都是斜体,而不应该是这样的:http://www.bbmthemes.com/themes/modular/
以下是我尝试过的代码,但它只将“Open Sans Italic”和“Open Sans Bold Italic”应用于所有内容,即使它不应该是斜体的时候:
@font-face {
font-family: 'opensans';
src: url('opensans-regular-webfont.eot');
src: url('opensans-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-regular-webfont.woff') format('woff'),
url('opensans-regular-webfont.ttf') format('truetype'),
url('opensans-regular-webfont.svg#open_sansregular') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'opensans';
src: url('opensans-semibold-webfont.eot');
src: url('opensans-semibold-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-semibold-webfont.woff') format('woff'),
url('opensans-semibold-webfont.ttf') format('truetype'),
url('opensans-semibold-webfont.svg#open_sanssemibold') format('svg');
font-weight: bold;
}
@font-face {
font-family: 'opensans';
src: url('opensans-italic-webfont.eot');
src: url('opensans-italic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-italic-webfont.woff') format('woff'),
url('opensans-italic-webfont.ttf') format('truetype'),
url('opensans-italic-webfont.svg#open_sansitalic') format('svg');
font-style: italic, oblique;
}
@font-face {
font-family: 'opensans';
src: url('opensans-semibolditalic-webfont.eot');
src: url('opensans-semibolditalic-webfont.eot?#iefix') format('embedded-opentype'),
url('opensans-semibolditalic-webfont.woff') format('woff'),
url('opensans-semibolditalic-webfont.ttf') format('truetype'),
url('opensans-semibolditalic-webfont.svg#open_sanssemibold_italic') format('svg');
font-weight: bold;
font-style: italic, oblique;
}
body {
font-family:'opensans';
font-size:78%;
}
这是一个问题的例子,注意所有字体都是斜体,而不应该是这样的:http://www.bbmthemes.com/themes/modular/