1

I have seen many a time user define Fonts in CSS like

font-family:"Times New Roman",Georgia,serif

AND

 font-family:Times New Roman,Georgia,serif

Does defining font in quotes make any difference i have seen this style couple of time.

I would appreciate an expert opening on this

Learning
  • 19,469
  • 39
  • 180
  • 373

3 Answers3

4

See the W3 documentation on that. It says:

Note: If a font name contains white-space, it must be quoted.

Alexxus
  • 893
  • 1
  • 11
  • 25
2

http://www.w3.org/TR/CSS2/fonts.html#font-family-prop

Font family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. This means most punctuation characters and digits at the start of each token must be escaped in unquoted font family names.

Font family names that happen to be the same as a keyword value ('inherit', 'serif', 'sans-serif', 'monospace', 'fantasy', and 'cursive') must be quoted to prevent confusion with the keywords with the same names. The keywords 'initial' and 'default' are reserved for future use and must also be quoted when used as font names. UAs must not consider these keywords as matching the '' type.

Community
  • 1
  • 1
Davor Mlinaric
  • 1,989
  • 1
  • 19
  • 26
1

Any font names that are more than one word are often wrapped in quotes, however this is not a requirement.

Why would font names need quotes?

Community
  • 1
  • 1
Phil Sinatra
  • 419
  • 3
  • 11