nickh
nickh

Reputation: 4841

Which monospace font does a browser use?

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?

Upvotes: 35

Views: 41390

Answers (3)

Austyn Wilson
Austyn Wilson

Reputation: 362

  1. Use DevTools
  2. Select HTML element
  3. Search for "Rendered Fonts"

Demo

Upvotes: 7

chavy
chavy

Reputation: 1068

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

Upvotes: 3

nickh
nickh

Reputation: 4841

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.

Upvotes: 31

Related Questions