6 ms·
There are lots of links, and a lot of them are crap (for example, most suggest garamond and helvetica). Here are my suggestions: sans: "font-family: Arial
by leif 16y ago
There are lots of links, and a lot of them are crap (for example, most suggest garamond and helvetica).
Here are my suggestions:
sans: "font-family: Arial, Verdana, Tahoma, sans-serif;"
serif: "font-family: Georgia, 'Times New Roman', Times, serif;"
mono: "font-family: 'Courier New', Monaco, monospace;"
Always remember to put the generic font type ('sans-serif', 'serif', 'monospace') at the end so browsers have something default to fall back on in all cases. For example, most linux distributions have a good monospace font defaulted, so you don't even need to try to guess a font (though 'Bitstream Vera Sans Mono' and 'DejaVu Sans Mono' are not bad guesses) there.
- powrtoch 16y agoPersonally I try to avoid putting Verdana or Georgia as backup fonts (In practice, the stacks you've listed are fine because almost no one will not have Arial installed, but by that logic you could leave out Verdana altogether). In principle, if we're imagining a situation where Arial isn't an option, falling back to Verdana will usually look pretty crazy, because Verdana is designed to appear so much larger. 12px Verdana just looks a lot bigger than 12px Arial. All this (including the part about it not mattering in practice) goes for Georgia (vs Times etc) as well.
- notahacker 16y agoAnyone that doesn't have Arial installed almost certainly won't have Verdana installed anyway. Helvetica would be a more logical fallback for those people who hate Arial so much they won't have it on their system...
- thristian 16y agoYe gods, please no more Courier New! Maybe, just maybe if you're trying to reproduce 1950s police reports or something, but there's so many much nicer monspaced fonts available these days. I'd start with: "Consolas", "Menlo", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace ...but you might want to include Andale Mono, Droid Sans Mono, Inconsolata, Lucida Console or Monaco as well.
- chadgeidel 16y agoI love Consolas, but really if your visitors are not on Vista/Windows 7 it's unlikely they will have it. EDIT: I believe there is a large population of folks that don't like ClearType hinted fonts. Consolas looks absolutely horrible unless you have ClearType on and tuned. I can't speak to Consolas on any Linux-based OS as I've never tried it.
- leif 16y agoI don't like it either, but people are used to it and it serves its purpose. You can put it after 'mono' if you like.