我正在尝试在具有两个不同权重(300和800)的html页面中使用Open Sans Web字体。但是这些权重之间的差异很小(已通过IE11和Chrome测试)。您可以在“我得到的东西”和“外观”下面看到这些图片(来自Google字体网站)。
我的结果:
Google的结果:
我的html代码是:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>font test</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans&subset=latin,vietnamese' rel='stylesheet' type='text/css'>
<link href="styles/style.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
Font Family: Open Sans <br />
font-weight 300: <span id="test">GGG</span><br />
font-weight 800: <span id="test2">GGG</span><br />
</body>
</html>
和CSS:
#test
{
font-family: 'Open Sans' !important;
font-style: normal !important;
font-weight: 300 !important;
font-size: 32px;
}
#test2
{
font-family: 'Open Sans' !important;
font-style: normal !important;
font-weight: 800 !important;
font-size: 32px;
}
我看不到你的体重
<link href='http://fonts.googleapis.com/css?family=Open+Sans&subset=latin,vietnamese' rel='stylesheet' type='text/css'>
替换为:
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,800' rel='stylesheet' type='text/css'>
它将起作用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句