1
votes

In CSS, which fonts are selected by generic font-family on common browsers/OS ?

Googled as much as possible, couldn't find an answer. This article mention Helvetica on Mac for sans-serif. This page provides font availability by OS.

So, which fonts are selected by generic font-family on common browsers/OS ?

  • serif
  • sans-serif
  • cursive
  • fantasy
  • monospace
1
font-family: Arial, Helvetica, sans-serif;Neeraj Prajapati

1 Answers

0
votes

There are no hard rules for this. And it can change. Best not to rely on this at all. A generic font is just that, generic.

If you want specific font(s), don't use generic family names, always use a concise font stack.

Generics like fantasy and cursive make it even more difficult as fonts like Comic Sans are seen as a bit of both... only serif/sans/monospace can be determined from the internal TTF OS2-panose, etc. tables reliably.

As for the answer, this is something you can easily find yourself by just viewing a page with each generic on various OSes and browsers you are targeting and then viewing the calculated font-family in the debugger.