CSS:备用字体 [英] CSS: Fallback fonts

查看:180
本文介绍了CSS:备用字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站使用了一个比较模糊的字体,大约有一半的电脑可以正常阅读。字体是Lucida控制台。
在无法读取此字体的计算机上,它们显示丑陋的Times New Roman,有没有办法将我的网站的字体设置为Lucida控制台,但是在无法读取它的计算机上,请查看Arial ?使用CSS。

解决方案

您可以指定多种字体:

  p {font-family:Times New Roman,Times,serif;} 

浏览器将尝试第一个,如果第二个不可用,依此类推。最后它使用家庭衬线,所以浏览器选择了任何衬线字体。你应该使用等宽家庭。



所以在你的情况下,这样的东西是你想要的:

 p {font-family:Lucida Console,Courier New,monospace;} 


My website uses a rather obscure font that about half the computers can properly read. The font is "Lucida Console". On the computers that can't read this font, they get displayed ugly Times New Roman, is there a way to set the font of my website to Lucida Console but on computers that can't read it, view Arial instead? Using CSS.

解决方案

you can specify multiple fonts:

p{font-family:"Times New Roman", Times, serif;}

The browser will try the first one, if that one isn't available the second, and so forth. In the end it uses the family serif, so the browser choses any serif font. You should use the monospace family.

So in your case, somthing like this is what you want:

p{font-family:"Lucida Console", "Courier New", monospace;}

这篇关于CSS:备用字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆