4
我無法讓Google網絡字體在Express 3.0中工作。Google網絡字體無法在Express中工作
加載標準方式的字體似乎不工作:
link(href='http://fonts.googleapis.com/css?family=Crete+Round')
但是在加載下列方式之一的字體正常工作:
script(type="text/javascript")
WebFontConfig = {google: { families: [ 'Crete+Round::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);
})();
或
style
@import url(http://fonts.googleapis.com/css?family=Crete+Round);
奇怪......它可能是另一個新的「特徵」表達式3.我已經做了幾次表達式2沒有問題。什麼是html輸出?你有什麼奇怪的東西嗎? – 3on 2012-08-14 23:43:11
如果您將'rel ='樣式表'type ='text/css''屬性添加到'link'標籤,它會起作用嗎?只要Express輸出您期望的HTML(查看源代碼),那麼它不是Express/Jade問題。 – 2012-08-14 23:48:44
@ 3on是的我沒有任何問題,快遞2 – jwerre 2012-08-15 16:43:09