Which monospace font does a browser use?

nickh picture nickh · May 3, 2013 · Viewed 15.4k times · Source

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?

Answer

nickh picture nickh · May 3, 2013

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.