This forum is now read-only. Please use our new forums at discuss.codecademy.com.

CSS: An Overview Forum

View Course

430 points
557ede39d3292f7a0000006a_306960922
Submitted by
wolfie
about 3 years ago

"First letter" of font-family always an upper case? CSS HTML

I came to notice that if the first letter of the property "font-family" in CSS is not in upper case, it doesn't work. Is the property case sensitive? Because I see HTML is usually not case sensitive language.If its a special case in this property, Where else in HTML the case sensitiveness apply?

ex: " font-family: Arial "(A - Upper case) works but not " font-family: arial " ( a - Lower case).


9 votes

permalink

Fonts have proper names, and like all names, deserve capitalization on all terms in the name.

Arial
"Times New Roman"
"Lucida Sans"

Notice also that names with multiple terms are always in quotes.

Font families are not proper names, so are never capitalized:

serif
sans-serif
monotype
cursive
fantasy

We would write a font list in order of preference, from best choice to default:

font-family: Arial, Helvetica, Verdana, sans-serif;

8120 points
5958b8ebe12813a2a3000034_980106998
Submitted by
Roy
about 3 years ago

9 Comments

557ede39d3292f7a0000006a_306960922 wolfie about 3 years ago

Understood.Thanku for the help.

53e0e7047c82cafff60025b4_845263950 shibazmalic about 3 years ago

Thanks SD Madhusudanan for asking the Question and Roy for providing an answer,
I found some useful information here.,That clears up the Quotations question I had about fonts and about the capitalization.

5674c6dae39efec455000434_879409444 Zeke Y almost 3 years ago

@Roy, is it actually required to have quotes around a multi word name? I always thought they did that just to make it look prettier.

5958b8ebe12813a2a3000034_980106998 Roy almost 3 years ago

The quote is necessary to keep the terms from looking like individual identifiers. It's one font name, not three.

5674c6dae39efec455000434_879409444 Zeke Y almost 3 years ago

OK, thanks.

543b30cc80ff33981d000e16_240100658 Alvin Chan almost 3 years ago

What's the difference between a font and font family?

5958b8ebe12813a2a3000034_980106998 Roy almost 3 years ago

Not very much. All fonts belong to a font family, be it proprietary or generic.

E778f825db201e3cb786a5dd57c9af0a?s=140&d=retro Deeppannu almost 3 years ago

thanks

C548b1444390c05212fdfdf598a28d6b?s=140&d=retro Whitney Ploof over 2 years ago

thks