"font-family: monospace, monospace"

Artisan72 picture Artisan72 · Aug 5, 2016 · Viewed 34.1k times · Source

I'm just curious, in normalize.css, the monospace font rules contain

font-family: monospace, monospace;

Is there a difference to

font-family: monospace;

? There must be a reason for using that. Maybe it's a workaround for the behaviour of some browsers?

Answer

Kyle O picture Kyle O · Aug 5, 2016

You are right. The font-family: monospace, monospace; declaration is a simple hack/workaround for some browsers which tend to reduce the font size of monospace fonts.

More info on this Github issue: https://github.com/necolas/normalize.css/issues/519#issuecomment-197131966