标记标记
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以从<pre>标签更改字体?例如,我不喜欢 courier 字体,但我喜欢 consolas 字体。我在css中改变了这个?
<pre>
我尝试了以下方法:
pre { color: white; font: "Consolas"; }
但这在 Firefox/IE 中不起作用...
谢谢!
伊万
font速记属性要求您指定字体大小。
font
改为使用该font-family属性。
font-family
font-family 应该可以工作。尝试
.pre { color: #fff; font-family:Consolas; }