SitePoint Sponsor

User Tag List

Results 1 to 13 of 13

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a way to override the browser font size settings with javascript. Basically we want to set the text size on a page so that if someone has their browser font setting say to "large" it does not take effect.

  2. #2
    SitePoint Zealot cckrocks's Avatar
    Join Date
    Nov 2000
    Location
    A home in the hills where the grass grows green an
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You dont need javascript to accomplish this, just use absolute sizes for your text. Instead of "font-size: 1" use "font-size 8pt" or "font-size 8px"
    Think beyond what is common...
    www.jaggedknife.com
    www.fusion-in.com

  3. #3
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your response. Dictating a point size is only good in Netscape is it not?? I have found a solution not by using javascript but by using a CSS and it is working just as we wanted.

  4. #4
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by kellyg
    Dictating a point size is only good in Netscape is it not?
    No, with CSS, all of the major browsers have supported it for a few years.

    Note: Why would you want to go against your visitors' wishes? It doesn't make sense to make choices for them. I set my font size large for easier reading and when I go to these "next-generation" sites with 8pt type it really makes me mad. Just my $1. Keep the change

  5. #5
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    because i have an image sliced to look like a story book and the images are in tables cells...to have bigger text, blows the table apart...thanks though

  6. #6
    SitePoint Zealot Jppr's Avatar
    Join Date
    Dec 2000
    Location
    Belgium
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you want real absolute sizes, you should go for pixels (px), not for points. Points are still relative to the browser settings.

    </jppr>

  7. #7
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may want to search this form, this topic has come up before.

    Basically, if someone sits a specfic font size in their browser or through the OS, you can not resize it with CSS or JavaScript. And there is good reason for this.

    Most folks who intentionally reset their font sizes do so because of poor eyesight. If you try to override this (you can't) then your defeating the purpose because they won't be able to read your site anyway.
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  8. #8
    SitePoint Zealot Jppr's Avatar
    Join Date
    Dec 2000
    Location
    Belgium
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well you're wrong there westmich. Try going to any article on SP, click on "Print this article" and than change font size to biggest in View (in IE4 for example).

    You'll see that nothing changes, except for the code.

    Just by using pixels.

    </thomas>

  9. #9
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I stand corrected
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  10. #10
    SitePoint Zealot Jppr's Avatar
    Join Date
    Dec 2000
    Location
    Belgium
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What exactly do you mean with "I stand corrected".
    (My mother language != English)

    Does it mean

    "You're right, I was wrong"

    or

    "I keep with my point of view, you're wrong"

    ??

    Thx
    </jppr>

  11. #11
    exit();
    Join Date
    Jul 2000
    Posts
    759
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It means that he knows that he was wrong and that you were right

  12. #12
    SitePoint Zealot Jppr's Avatar
    Join Date
    Dec 2000
    Location
    Belgium
    Posts
    132
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, thanks mkaufman.

    So it is possible, but westmich has a point here:

    Most folks who intentionally reset their font sizes do so because of poor eyesight. If you try to override this then your defeating the purpose because they won't be able to read your site anyway.
    So when you switch to absolute sizes, check on Macintosh computers (they see everything a bit smaller) how your site looks. If you can read it, and you have "average" eyes, you can suppose that others will see it too.

    But, if your site is made for people of, let's say, 45 and older, don't use tiny font sizes. Adapt them.

    For those of you that want an overview of how different browsers display fonts etc., visit
    http://hotwired.lycos.com/webmonkey/...html?tw=design

    Cheers

  13. #13
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by mkaufman
    It means that he knows that he was wrong and that you were right
    Correct! I offer my most humblest apologies
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com


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
  •