SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    text size hack problem

    arrghh!

    could anyone see anything wrong with this code. IE is still not interpreting it correctly:

    HTML Code:
    body {
    text-align : center; 
    font-family : "trebuchet ms" Verdana, Arial, Helvetica, sans-serif;
    font-size: small;
    }
    
    * html body {
    font-size: x-small; /*for IE5*/
    f\ont-size: small; /*for all other IE versions*/
    }
    
    html>body { 
    /*be nice to opera*/
    font-size: small;
    }
    ?

  2. #2
    SitePoint Enthusiast Northern Star's Avatar
    Join Date
    Aug 2006
    Location
    Cheshire, UK
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using

    Code:
    font-size: small;
    means you are relying on the browser to determine what it deems as being 'small' - you'd be better working with fixed or relative values such as '12px' or '1.8em'.
    "If it ain't broken, don't fix it!"
    ----
    Northern Star - Web design, stategy & development.

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im using percentages to size my text.

    means you are relying on the browser to determine what it deems as being 'small'
    Thats The reason im using the hack above. It makes every IE interpret small the same way as every other browser, it equates to about 12px i think.

    Im not using fixed pixel values as IE cant resize those which is bad for accessibility.

    I just posted because i though there might be something wrong with the code but ive checked a few sites since and it seems i have it right

  4. #4
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,495
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put a comma after "trebuchet ms" and you should be fine. The browser is trying to read "trebuchet ms" Verdana as one font, when in fact it's two.

    "trebuchet ms", Verdana is the way it should look.

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2005
    Location
    London
    Posts
    1,678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ahh, See i knew there was something i couldnt spot! Thanks Dan


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
  •