scott_blanchard — 2011-04-18T12:20:52-04:00 — #1
I've seen multi-word font families encapsulated with single quotes, double quotes and no quotes.
Are there browser compatibility issues with any of the above?
font-family:Lucida Sans Unicode, Lucida Grande, sans-serif;
font-family:'Lucida Sans Unicode', Lucida Grande', sans-serif;
font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif;
font-family:"Lucida Sans Unicode", Lucida Grande, sans-serif;
samanime — 2011-04-18T12:39:26-04:00 — #2
font-family (CSS property)
Essentially, you can do whatever you want, though it's best to put it in double-quotation marks.
paulob — 2011-04-18T16:46:18-04:00 — #3
These paragraphs from the link samanime gave above should clarify the situation a little:
The values are either font family names or generic family names. Font family names are quoted or unquoted strings, while generic family names are keywords and shouldn’t be quoted.
It’s a good idea to quote any font family name that contains spaces or other non-alphanumeric characters. Special characters must be escaped if the value isn’t quoted. Whitespace characters will be ignored at the beginning or end of an unquoted name, and multiple white space characters inside the name will collapse to a single space.
Also, if a font family name happens to be the same as a generic family name or any other CSS keyword, it must be quoted to avoid confusion.
scott_blanchard — 2011-04-20T10:24:48-04:00 — #4
Thanks guys. I appreciate the references and explanation. It appears that its more a recommendation than a rule. However, no specifics on single vs double quotes, so I suppose that doesn't matter.
paulob — 2011-04-20T15:32:13-04:00 — #5
Either/or are fine as long as they are correctly matched.
black_max — 2011-04-20T17:23:04-04:00 — #6
This is the way I do it. Not saying my way is by definition correct, but from the research and reading I've done, this is considered "best practices."
system — 2014-10-07T21:03:32-04:00 — #7
This topic is now closed. New replies are no longer allowed.