问题
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