SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2002
    Location
    ../home/
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Font sizes (px, pt...)

    Hello. I want my visitors to be able to change font sizes in IE, so defining the font size in my sheet with pixels is out of the question. Can you please in short explain, or simply paste a few links, what other units are safe to use. I've seen sites use PT's, for instance.

    I've tried setting the font size to 70%, which works just fine in my browser, but are there difficulties in other browsers? Also, if I define the size as 70%, what other parameters need adjusting (body?)?

    I know I can use a JS or PHP style swither, but I want to explore this option as well...

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    If you want IE users to be able to resize text, you have to either a) use relative units such as percentages or ems, or b) use a styleswitcher. IE/Windows has the same quirks if you set the font in points or pixels, namely that the user can't resize the text on their own. Besides, using points isn't a very reliable measurement for screen, since it's a print measurement. Keep it in your print-media stylesheet.

  3. #3
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Set your body font-size to a percentage (e.g. font-size: 80%), and then set the rest of your styles using ems (1.0em being the standard size for most of your site).

    Check that your chosen percentage is readable when you make the text size Smallest.

    Then all you need to do if you want to change the size of text on your site is change the percentage value in the body tag, and all the text will scale up/down as necessary.

  4. #4
    100% Windoze-free earther's Avatar
    Join Date
    Feb 2003
    Location
    Linuxland
    Posts
    2,788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The tutorial at http://www.thenoodleincident.com/tut...x.html#screens discusses font sizing in detail. Check it out.

  5. #5
    SitePoint Enthusiast
    Join Date
    Dec 2002
    Location
    ../home/
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies. Is setting my paragraph (tag 'p') style to, let's say, 80% correct? What I mean is, if I set the size for body to 100% (font-size: 100%), can I then use percentages for other styles, or is using em's the correct way?


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
  •