Is there a way to set the *default* monospace font in Safari? I have a web application that uses the browser's default monospace font. It's set up that way so that the user can pick their own. In Chrome, this works well, as it's easy to set the default fonts, but in Safari, they removed the option.

Is there some way for users to set default fonts in Safari?
The following information was correct when it was posted, but now only applies to obsolete versions of Safari.



There are unexposed preferences for changing the default fonts and font sizes:

defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2StandardFontFamily Georgia
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DefaultFontSize 16
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2FixedFontFamily Menlo
defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DefaultFixedFontSize 14


Another option is to edit the CSS file that defines the default styles (look in
Preferences > Advanced > Stylesheet), adding something like this, for example:

@font-face {
   font-family: monospace;
   src: local('Menlo');
}


That rule makes any element that uses font-family: monospace (as well as elements like &lt;pre&gt; and &lt;code&gt; by default) use Menlo. Just change the font name (being careful to keep the enclosing quotes) to whatever you prefer.