Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should CSS font-family value use quotes? [duplicate]

When should the value for CSS 'font-family' have quotes around it?

I've seen both font-family: arial and font-family: "arial".

As a specific example, I declare a font this way:

@font-face {
    font-family: 'entypo';
    font-style: normal;
    font-weight: 400;
    src: url('/css/fonts/entypo.woff') format('woff');
}

What would be the correct CSS to have an element use this font-family?

like image 276
Don P Avatar asked Mar 05 '13 16:03

Don P


1 Answers

You only need quotes when the font itself has a space such as "Times New Roman".

Arial does not need quotes, but some people use quotes such as "Arial" to be more consistent. It is simply personal preference.

Seen in Justin's below comment: font-family: times new roman; works without quotes (JSFiddle).

You can call your new @font-face using font-family: 'entypo'; as you would normally expect. (link)

like image 65
mswieboda Avatar answered Nov 24 '22 02:11

mswieboda