Why would font names need quotes?

后端 未结 5 576
青春惊慌失措
青春惊慌失措 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:35

    I've just learned myself that the quotes aren't ever necessary but rather recommended. We all learn something new every day.

    The other place you see them is in css properties that require a url

    background:url('hithere.jpg');
    background:url(hithere.jpg);
    

    Both those statements are going to work exactly the same. Same goes for the fonts, which type of quote you use is irrelevant in this case, just be consistent in how YOU do things and that is all that really matters.

提交回复
热议问题