Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: CSS font sizes

  1. #1
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    What CSS font sizes can I use that look the same in all browsers but still scale when the user requests it in the browser (for example, in IE, View > Font Size > Larger). px and pt don't work (that I know of) because they remain fixed. small in Mozilla looks like x-small in IE, so the font sizes designed explicitly for accessibility don't work. Neither do percentages.

    Ideas?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  2.  

  3. #2
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    %, em, and small-large are the only way IE works to scale them. In mozilla you can scale any text, no matter it's definition.

    However, none of these sizes are compatable across-platforms except for px because pixels are somewhat standard. So... meh.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  4. #3
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    What's one em equal (about)?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  5. #4
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    .5em is like 14pt font of PC or so.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  6. #5
    Dan
    Dan is offline
    Member
    Join Date
    Feb 2003
    Posts
    39
    Member #
    707
    Actually, what you could do is to make a seperate stylesheet with just font-sizes. It's okay to redefine them, they'll be appended to the original styles. Now, what you do, is (I believe you know PHP so I won't go into detail) make a link that sets a font-size cookie. This will echo out a different stylesheet name, thus larger/smaller font sizes. Since IE doesn't like em, % for fonts is icky, and ex/px/pt only expand with Mozilla, having a link is your best bet. If you're good at javascript, you might be able to re-write the link and auto-change it and set a cookie. Long-winded, but oh well!

  7. #6
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    I was hoping to avoid browser detection, though...
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  8. #7
    Dan
    Dan is offline
    Member
    Join Date
    Feb 2003
    Posts
    39
    Member #
    707
    You don't need browser detection. Say you use javascript, you target the href on the <link> which is for the font stylesheet. Just replace the href and bam, font-size has been changed. This works for any browser, providing it supports Javascript, which is a LOT of them.

  9. #8
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Yes, but wouldn't user intervention then be required?
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  10. #9
    Dan
    Dan is offline
    Member
    Join Date
    Feb 2003
    Posts
    39
    Member #
    707
    Yes, a click of a button. If they use View > Font Size > Larger, then they still have to set it.. this is probably easier, in a sense.

  11. #10
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Most commercial apps use a stylesheet for each browser for fonts with browser detection to set the appropriate one.

    But EM (as Brak stated) is compatible in it's default setting (Medium / 100%) across IE and Moz

    I used EM font sizes for this proposal:

    http://www.stevenmoseley.com/stu/home.html


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:20 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com