0
我有以下代碼。它在所有四種情況下都能正確顯示。但是,當div複製(右鍵單擊/複製)並粘貼到Word文檔中時,四個div的字體順序爲:Times
,Trebuchet
,Courier
,Trebuchet
。複製/粘貼忽略CSS字體
字體只能用內聯樣式集識別。任何想法爲什麼css
字體被忽略copy
?更重要的是,我可以在我的CSS中解決這個問題,還是我在每種情況下都使用內聯代碼顯式設置字體?
這也是有趣的是,爲<pre>
默認爲Courier
但對於<div>
是Times
(都爲我的瀏覽器和MS Word缺省設置)。如果<pre>
沒有給我Courier
,我幾乎可以接受輸出。
<style>
pre {font-family:"trebuchet ms",arial,sans-serif;}
.test {font-family:"trebuchet ms",arial,sans-serif;}
</style>
<div class="test">
Test of div with css set font
</div>
<div class="test" style="font-family:'trebuchet ms',arial,sans-serif">
Test of div with inline font
</div>
<div>
<pre>
Test of pre with css set font
</pre>
</div>
<div>
<pre style="font-family:'trebuchet ms', arial, sans-serif">
Test of pre with inline font
</pre>
</div>
當使用內嵌css指定字體時,它們顯示出來。問題不在於缺少字體。 – mseifert 2014-08-29 23:01:14