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?
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With