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