This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by KnuckledHedgehog
almost 11 years

Why do you have to capitalize the font-family name?

Only certain lessons require the name to be capitalized. Is it because certain browsers may not recognize the name otherwise?

Answer 521b3d6f80ff332f3900150a

5 votes

Permalink

You don’t have to capitalize the font-family name. The W3C standard requires that browsers match font names case insensitively using a specific algorithm. In fact, web browsers have treated font-family names case insensitively long before that standards document made it official.

points
Submitted by GrapeStomp
over 10 years

2 comments

tony de araujo over 10 years

This is a good point. However this applies if you use the @font-face rule. @font-face is a css rule which allows you to download a particular font from your server to render a webpage if the user hasn’t got that font installed. NOT EVERY BROWSER SUPPORTS IT. When using conventional font names it is best to code them exactly as they are called which may mean to capitalize the first character if that’s the way they were originally published.

tony de araujo over 10 years

Answer 5192d22bfb083d2e7700049a

1 vote

Permalink

Font names should be capitalized.When the name of a font is more than one word, it should be quoted, as in “Times New Roman”. When you see a lower case font name it is a generic name and not a named font. Example:

font-family: Helvetica, "Nimbus Sans L", "Liberation Sans", Arial, sans-serif;
points
Submitted by tony de araujo
almost 11 years

5 comments

Fabio Bracht almost 11 years

I’m sure you meant “generic”, not “genetic”.

tony de araujo almost 11 years

I did it again, every time I write late at night I seem to write genetic for generic. Going to correct it, Thanks!

DukeDickinson about 9 years

Sorry to bring up a dead question. But why exactly this convention is followed?

tony de araujo about 9 years

When we use names of fonts we are calling something outside of the HTML library. HTML is case insensitive but we cannot assume that everything else out there is case insensitive, for example, JavaScript which is used in every HTML page is case sensitive and an a or an A are two different entities. The same for font names, a generic font does not refer to any font specific so it may work one way or the other, however, a previously named font such as Helvetica, or Verdana, those are registered names, they need to be called exactly as they were registered.

DukeDickinson about 9 years

Makes sense. Thanks for the answer.