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
almost 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;

7734 points
58dc9a7fdd1edef33e000457_828040695
Submitted by
Roy
almost 3 years ago

9 Comments

557ede39d3292f7a0000006a_306960922 wolfie almost 3 years ago

Understood.Thanku for the help.

53e0e7047c82cafff60025b4_845263950 shibazmalic almost 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 over 2 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.

58dc9a7fdd1edef33e000457_828040695 Roy over 2 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 over 2 years ago

OK, thanks.

543b30cc80ff33981d000e16_240100658 Alvin Chan over 2 years ago

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

58dc9a7fdd1edef33e000457_828040695 Roy over 2 years ago

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

E778f825db201e3cb786a5dd57c9af0a?s=140&d=retro Deeppannu over 2 years ago

thanks

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

thks