这是我的样式表的顶部:
@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;
}
有什么想法吗?
答案 0 :(得分:0)
要使第二个@font-face
正常工作,您需要将body font-family更改为
body{
font-family: "open_sansregular";
}
或更好
body{
font-family: "Open Sans", "open_sansregular", sans-serif;
}