下面的网站(http://www.ecu.edu/english/tpc/tpcintern/index.cfm)应该使用Google Web字体,这些字体在除Safari之外的所有浏览器中都能完美显示。使用的Javascript是:
WebFontConfig = {
google: { families: [ 'Lato:100:latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})(); 我知道JS没有使用这些标记,但我删除了它们,因为CommonSpot需要删除它们。实际上使用了几种不同的Web字体,但除了相关的字体信息之外,每种字体的JS都是相同的。CSS的一个示例如下:
#navigation {
font-family: 'Lato', sans-serif;
font-size: 1.3em;
font-style: normal;
float: left;
margin: .5em 0 0 .5em;
width: 70%;
height: 2em;
position: relative;
padding: .5em 0;
text-transform: uppercase;
font-size: 1em;
background-color: #592a8a;
}最后,网页字体是由Google托管的,如果这有区别的话(我不认为会有区别,因为它们似乎在其他浏览器上也能工作?)。
发布于 2013-04-14 03:38:16
CommonSpot和它处理JavaScript的方式有问题。对于其他使用CommonSpot的用户,只需使用JavaScript创建一个单独的HTML文件,将其上传到CustomCF文件夹,然后通过CommonSpot附加。
https://stackoverflow.com/questions/15801413
复制相似问题