我正在使用Google Web Font的PT-sans
font-family: 'PT Sans',Arial,serif;
但它在Chrome和Firefox中看起来不同
有没有什么需要我添加的,以便它在所有浏览器中看起来都一样?
发布于 2011-01-15 15:55:42
css重置可能会解决这个问题,我不确定。
发布于 2011-12-11 20:21:43
对于来自FontSquirrel的ChunkFive字体,指定" font -weight: normal;“阻止了火狐在标题中使用时的渲染效果看起来很糟糕。看起来Firefox试图对只有一个粗体的字体应用一个假粗体,而Chrome则不是。
发布于 2012-09-06 23:06:25
对我来说,Chrome网页字体看起来很糟糕,直到我把SVG字体放在WOFF和TrueType之前。例如:
@font-face {
font-family: 'source_sans_proregular';
src: url('sourcesanspro-regular-webfont.eot');
src: url('sourcesanspro-regular-webfont.eot?#iefix') format('embedded-opentype'),
url('sourcesanspro-regular-webfont.svg#source_sans_proregular') format('svg'),
url('sourcesanspro-regular-webfont.woff') format('woff'),
url('sourcesanspro-regular-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
即便如此,Chrome的字体看起来还是比Firefox或IE要薄。Chrome在这一点上看起来不错,但我通常想在IE和Firefox中设置不同的字体。我混合使用IE条件注释和jQuery来根据浏览器设置不同的字体。对于Firefox,我让以下函数在页面加载时运行:
function setBrowserClasses() {
if (true == $.browser.mozilla) {
$('body').addClass('firefox');
}
}
然后在我的CSS中,我可以说
body { font-family: "source_sans_proregular", Helvetica, sans-serif; }
body.firefox { font-family: "source_sans_pro_lightregular", Helvetica, sans-serif; }
同样,在IE条件注释中包含的仅限IE的样式表中,我可以这样说:
body { font-family: "source_sans_pro_lightregular", Helvetica, sans-serif; }
https://stackoverflow.com/questions/4698564
复制相似问题