Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    dynamic font sizes

    I'm not sure how to express this but I have found that when I optimize a web page on a screen resolution of 1440 X 900, it does not look good at all with other resolutions. For example, single line menu items will wrap if the screen has a 640 X 480 resolution.

    Is there any way using HTML to determine the screen resolution and adjust the font size accordingly? Maybe also to adjust image size as well.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: dynamic font sizes

    Hi Don

    The best way to do this is to not to use fixed pixel font sizes or to use ems (pronounced like the letter M) or to use percentage to create the heights.

    I know you don't want to here this but by far the easisiest way to do this is to use Cascading Style Sheets (CSS) or settings within the <style> tags. An example on how to do this is:

    <style>

    h1{
    font-size: 120%;
    color: #334d55;
    }

    h2{
    font-size: 114%;
    color: #006699;
    }

    h3{
    font-size: 100%;
    color: #334d55;
    }

    h4{
    font-size: 100%;
    color: #333333;
    }

    ...
    </style>

    Both em and percent (%) are relative measures. The difference is what each is relative to. Em is always relative to font size. percent is relative to the containing block, usually the body, a div, or a table, unless applied to font-size, in which case it applies to the parent font-size.

    An em is a unit of measurement in the field of typography, equal to the pt size of the current font.

    One way to see the difference is

    1 em = 100%

    0.5 em = 50%
    Jerry

  3. #3
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: dynamic font sizes

    I have pretty much resigned myself to using CSS; I am now going through a tutorial on same. Back to fonts. I agree about using percentages to represent variations of the basic font size and leaves me sort of (I think) back at my original question of how to establish the basic (normal) font size for various screen resolutions. Or did I miss your point entirely?

  4. #4
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: dynamic font sizes

    Hi Don

    No you haven't missed the point at all, it was more likely me seeing the problem and bulldozing my way through it to try and get a better result <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    I personally do not use fixed font or div , table or span settings so that the pages are able to float and adjust to the browser size. Note how I mention browser size and not monitor size, you will be amazed by the number of people who do not actually have their browser windows set to maximized when they browse.

    If this is still an issue, users still have the option to change text size (Yes I know you are talking about the viewport but this is connected)

    This is quite a good tutorial:

    http://www.netmechanic.com/products/...Tutorial.shtml that talks of browser window size and monitor sizes.

    However, if you want the javascript code you can use the code that is linked from this page:

    http://marylandmedia.com/2006/08/800x600-s...-i-really-care/

    this wil require you to create different CSS files to fit different monitor widths which then puts us back to the beginning of my point. This looks great but it is a lot of hard work.

    I hope that helps?
    Jerry

  5. #5
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: dynamic font sizes

    Not sure what a 'viewport' is but I am glad you mentioned browser size; I had not thought about that and I do like the idea of the web page fitting the browser. I presume that means that if the user changes the browser size (even if they maximize it), the webpage will adjust accordingly. That is cool. I will review the links to try and understand.

Posting Permissions

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