Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2008
    Posts
    50
    Thanks
    18
    Thanked 0 Times in 0 Posts

    CSS Font Family - Family Name and Inherit?

    The default CSS font family set for my website is as follows:

    Code:
    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:

    Code:
    .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:

    Code:
    .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:

    Code:
    .text {font-family:"Arial Black", inherit;}
    So basically, is it okay to write font-family CSS in this "family name" + "inherit" format?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,728
    Thanks
    6
    Thanked 1,015 Times in 988 Posts
    No, you can’t. You always have to specify alternative fonts.

  • Users who have thanked VIPStephan for this post:

    Inersha (04-13-2011)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •