Why would font names need quotes?

后端 未结 5 552
青春惊慌失措
青春惊慌失措 2020-12-02 17:58

As far as I know, one needs to use double or single quotes for fonts if they contain spaces, like:

font-family: \"Times New Roman\", Times; 
font-family: \'T         


        
5条回答
  •  再見小時候
    2020-12-02 18:45

    You can always put a specific font family name in quotes, double or single, so Arial, "Arial", and 'Arial' are equivalent. Only the CSS-defined generic font family names like sans-serif must be written without quotes.

    Contrary to popular belief, a font name consisting of space-separated names such as Times New Roman need not be quoted. However, the spec recommends “to quote font family names that contain white space, digits, or punctuation characters other than hyphens”

提交回复
热议问题