SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: How to change font ONLY if using Mozilla Firefox

  1. #1
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to change font ONLY if using Mozilla Firefox

    Hi there,

    I have created my online portfolio using a Tumblr theme here: www.ellekorhaliller.co.uk

    As you can see it uses an font that works in every browser apart from Mozilla because it is externally hosted and I do not own the font myself.

    I would like to create a statement that changes the font IF the browser is Mozilla.. Like the <!--if IE statements but I know these are IE specific.

    I want to make sure that my code can determine if the user is using Mozilla and if so I want to then use a Google Web Font.

    Any help would be much appreciated.

    Best,

  2. #2
    Mouse catcher silver trophy
    SitePoint Award Recipient Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,105
    Mentioned
    66 Post(s)
    Tagged
    1 Thread(s)
    Can you not just use a font stack and put the back-up font second in the list? That way any browsers that can use the first font will do so, and any that can't will move on to the second one.
    Any posts I write in Arial are on my mobile phone, so please excuse typos etc.
    Any posts I write in Verdana are on a PC, so feel free to berate me mercilessly for any mistakes


  3. #3
    It's all Geek to me silver trophybronze trophy
    SitePoint Award Recipient ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, Australia
    Posts
    19,996
    Mentioned
    217 Post(s)
    Tagged
    2 Thread(s)
    Do you have access to the CSS on the original site? If so, as Stevie says, add fallback fonts in you style sheet. E.g.

    Code:
    body {
    background-color:#ffffff;
    font-family:'BrownBold', 'century gothic', callibri, arial, helvetica, sans-serif;
    color:#000000;
    font-size:17px;
    line-height:25px;
    }
    Those are just random fonts I typed, and it would be better to identify common fonts that people have on their computer that look more like BrownBold.

    It's a real pain the FF often chokes on FontSquirrel fonts. We get a lot of threads here about that.

Bookmarks

Posting Permissions

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