user81993 user81993 - 8 days ago 7
CSS Question

How do you use the font shorthand if your font has a space in it?

For instance

@import url('https://fonts.googleapis.com/css?family=Open+Sans');

div {
font:12px black "Open Sans";
}


Isn't accepted by chrome, using single quotes or no quotes doesn't help either. How do you use the font without writing an extra line for font-family?

Answer

Actually, the black is what makes that line of CSS invalid. font: 12px "Open Sans"; should work perfectly (and does when I try on Chrome). If you're trying to set font color, do it with the color: black; property.