0

这是我的样式表的顶部:

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: local('Open Sans'), local('OpenSans'), url(https://themes.googleusercontent.com/static/fonts/opensans/v6/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff) format('woff');
}
body{
    font-family:"Open Sans";
    background-image:url(images/greyFadeBG.jpg);
    background-repeat:repeat-x;
    background-color:#ffffff;
    margin:0px;
    padding:0px;
    height:100%;
    min-width:870px;
    font-size:14px;
    color:#666666;
}

这将在 IE(9 和 10) 中显示自定义字体如果我从 font-family:"Open Sans"; to font-family:"Open Sans", sans-serif;

自定义字体会在 IE7 中显示,但所有 IE 版本都会显示 san-serif 字体。

我已经从 Font Squirrel 尝试过这个,但没有运气:

@font-face {
    font-family: 'open_sansregular';
    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;

}

有任何想法吗?

4

1 回答 1

0

要使第二个@font-face工作,您需要将 body font-family 更改为

body{
    font-family: "open_sansregular";
}

或者更好

body{
  font-family: "Open Sans", "open_sansregular", sans-serif;
}
于 2013-03-15T21:35:39.373 回答