Which monospace font does a browser use?

我是研究僧i 提交于 2020-01-02 00:11:07

问题


With CSS, if you specify font-family: monospace;, my understanding is that the browser chooses its default/preferred monospaced font.

If that's correct, how can you determine which monospaced font your browser is using?


回答1:


There are 5 generic families that can be used: "serif", "sans-serif", "cursive", "fantasy", and "monospace". When a browser sees one of those, it asks the operating system for the default font in that family.

Thus, which font a web browser uses is OS-dependent.

See Mozilla's documentation on font-family for details.




回答2:


In my case, that was lucida console font. Maybe helps someone)



来源:https://stackoverflow.com/questions/16362998/which-monospace-font-does-a-browser-use

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!