In almost all CSS font-family declarations I've seen, the first font selection is quoted.
Example:
{
font-family:"Times New Roman", Georgia, Serif;
}
The first 2 selections are both specific fonts, while the third selection 'Serif' is a generic font family. Why is Times New Roman in quotations, but not Georgia? This discussion talks about how quotations are not always needed, but it doesn't explain why only the first selected font would be in quotations.
Quotes are recommended in the spec with "font family names that contain white space, digits, or punctuation characters other than hyphens". Quotes are required around font-family names when they are not valid CSS identifiers.
Why is the name of one of the fonts put in quotes? . it consists of two words or it shows a font family or to support "fallback" or it is a rarely used font...
Not all browsers support all the fonts. So, giving multiple font families select the font that is supported by the browser, starting from the first font. If first font is supported then it is used, otherwise it checks if next font is supported and so on.
There are two types of font family names: family-name - The name of a font-family, like "times", "courier", "arial", etc. generic-family - The name of a generic-family, like "serif", "sans-serif", "cursive", "fantasy", "monospace".
It's because Times New Roman has spaces, any other that has should be quoted as well.
This is interesting, I figure it has to do with spacing in the name.
The official spec says this:
To avoid mistakes in escaping, it is recommended to quote font family names that contain white space, digits, or punctuation characters other than hyphens:
So, it probably has nothing to do with being the first one :-)
Reference: http://www.w3.org/TR/CSS21/fonts.html#font-family-prop
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With