View Full Version : CSS Font Family - Family Name and Inherit?

04-13-2011, 03:41 PM
The default CSS font family set for my website is as follows:

body {font-family:Arial, Helvetica, sans-serif;}

Recently, I wanted some certain pieces of text to have the "Arial Black" fon't, so I assigned it like this:

.text {font-family:"Arial Black";}

However, this meant that if the user didn't have Arial Black installed (e.g. iPhone users), the font would default to Times New Roman instead of the default font family for the pages as shown above.

So, instead of writing the backup family names like this:

.text {font-family:"Arial Black", Arial, Helvetica, sans-serif;}

Can I write the family name I want first, and then use "inherit" for the backup font families? Like this:

.text {font-family:"Arial Black", inherit;}

So basically, is it okay to write font-family CSS in this "family name" + "inherit" format?

04-13-2011, 04:16 PM
No, you can’t. You always have to specify alternative fonts.