Conditional formatting for font size?

Discussion in 'HTML' started by Charlie, Sep 6, 2009.

  1. Charlie

    Charlie Guest

    I've heard that conditional formatting has no place in purist HTML,
    but I'm still keen to see if I can do the following.

    I'd like a piece of text to be sized at 32 point at a screen
    resolution of 1024x768, and 42 point at 1280x1024. Can this be done?

    Thanks,

    Charlie
    Charlie, Sep 6, 2009
    #1
    1. Advertising

  2. Charlie wrote:

    > I've heard that conditional formatting has no place in purist HTML,
    > but I'm still keen to see if I can do the following.


    This strongly suggests that you have very little understanding of what HTML.
    It's a poor lonesome data format.

    > I'd like a piece of text to be sized at 32 point at a screen
    > resolution of 1024x768, and 42 point at 1280x1024. Can this be done?


    Under some serious caveats, it can, but definitely not in HTML.

    But it's a clueless idea.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Sep 6, 2009
    #2
    1. Advertising

  3. Charlie

    Andy Dingley Guest

    On 6 Sep, 17:28, Charlie <> wrote:
    > I've heard that conditional formatting has no place in purist HTML,
    > but I'm still keen to see if I can do the following.
    >
    > I'd like a piece of text to be sized at 32 point at a screen
    > resolution of 1024x768, and 42 point at 1280x1024. Can this be done?


    Yes. JavaScript to sniff the size, then set some CSS on that basis.

    It's a dumb idea though. Asking for "points" is unlikely to give you
    points that are the same size as a printer's, as the desktop doesn't
    know how physically large its pixels are on the glass.

    Secondly you're basing choices on screen size when it's usually window
    size that's more significant. Admittedly this might be a case when it
    isn't.
    Andy Dingley, Sep 6, 2009
    #3
  4. On Sep 6, 12:28 pm, Charlie <> wrote:
    > I've heard that conditional formatting has no place in purist HTML,
    > but I'm still keen to see if I can do the following.
    > I'd like a piece of text to be sized at 32 point at a screen
    > resolution of 1024x768, and 42 point at 1280x1024. Can this be done?


    What are you actually trying to do?
    Travis Newbury, Sep 6, 2009
    #4
  5. Charlie

    Charlie Guest

    On 6 Sep, 17:42, "Jukka K. Korpela" <> wrote:
    > Charlie wrote:
    > > I've heard that conditional formatting has no place in purist HTML,
    > > but I'm still keen to see if I can do the following.

    >
    > This strongly suggests that you have very little understanding of what HTML.
    > It's a poor lonesome data format.
    >
    > > I'd like a piece of text to be sized at 32 point at a screen
    > > resolution of 1024x768, and 42 point at 1280x1024. Can this be done?

    >
    > Under some serious caveats, it can, but definitely not in HTML.
    >
    > But it's a clueless idea.
    >
    > --
    > Yucca,http://www.cs.tut.fi/~jkorpela/


    Yes, I understand that about HTML, but I thought that I'd risk the
    wrath of contributors here to ask the question and learn something.
    Shame that it seems unwise to do so. I'd better abandon this question
    right now.
    Charlie, Sep 7, 2009
    #5
  6. Charlie

    Charlie Guest

    On 6 Sep, 21:06, Travis Newbury <> wrote:
    > On Sep 6, 12:28 pm, Charlie <> wrote:
    >
    > > I've heard that conditional formatting has no place in purist HTML,
    > > but I'm still keen to see if I can do the following.
    > > I'd like a piece of text to be sized at 32 point at a screen
    > > resolution of 1024x768, and 42 point at 1280x1024. Can this be done?

    >
    > What are you actually trying to do?


    I'm looking at a website that has a frameset of 3 frames, a banner at
    the top, a main content section and a navigation frame at the bottom.
    The banner has just the company logo in it, or on occasions it has
    contained just the name of the company in text format. This displays
    fine at the higher resolutions, but if you view the site at 1024x728,
    half of the logo/text is obscured at its bottom edge. If I change it
    to something smaller to accommodate the lower resolutions, it looks
    feeble and silly at the higher ones. Hence the interest in doing
    something conditional on resolution.

    Thanks,

    Charlie
    Charlie, Sep 7, 2009
    #6
  7. On 6 Sep., 19:37, Andy Dingley <> wrote:
    > On 6 Sep, 17:28, Charlie <> wrote:
    >
    > > I've heard that conditional formatting has no place in purist HTML,
    > > but I'm still keen to see if I can do the following.

    >
    > > I'd like a piece of text to be sized at 32 point at a screen
    > > resolution of 1024x768, and 42 point at 1280x1024. Can this be done?

    >
    > Yes.  JavaScript to sniff the size, then set some CSS on that basis.


    Here a nice explaination to change css:
    http://www.quirksmode.org/dom/changess.html

    That's another part of "Old Java Pages" how to detect to browser:
    http://www.quirksmode.org/js/detect.html

    > It's a dumb idea though. Asking for "points" is unlikely to give you
    > points that are the same size as a printer's, as the desktop doesn't
    > know how physically large its pixels are on the glass.
    >
    > Secondly you're basing choices on screen size when it's usually window
    > size that's more significant. Admittedly this might be a case when it
    > isn't.


    Yes, I also wonder if it is possible to get the screen size (e.g.
    22").
    Maybe Charlie is fond of something like this:
    http://www.pageresource.com/jscript/jscreen.htm
    Jan C. Faerber, Sep 7, 2009
    #7
  8. Charlie

    Doug Miller Guest

    In article <>, Charlie <> wrote:
    >On 6 Sep, 21:06, Travis Newbury <> wrote:
    >> On Sep 6, 12:28=A0pm, Charlie <> wrote:
    >>
    >> > I've heard that conditional formatting has no place in purist HTML,
    >> > but I'm still keen to see if I can do the following.
    >> > I'd like a piece of text to be sized at 32 point at a screen
    >> > resolution of 1024x768, and 42 point at 1280x1024. Can this be done?

    >>
    >> What are you actually trying to do?

    >
    >I'm looking at a website that has a frameset of 3 frames, a banner at
    >the top, a main content section and a navigation frame at the bottom.
    >The banner has just the company logo in it, or on occasions it has
    >contained just the name of the company in text format. This displays
    >fine at the higher resolutions, but if you view the site at 1024x728,
    >half of the logo/text is obscured at its bottom edge. If I change it
    >to something smaller to accommodate the lower resolutions, it looks
    >feeble and silly at the higher ones. Hence the interest in doing
    >something conditional on resolution.


    A better solution is probably to redesign the page using CSS to lay out the
    sections, and abandon the framesets.
    Doug Miller, Sep 7, 2009
    #8
  9. On 7 Sep., 14:23, (Doug Miller) wrote:

    > A better solution is probably to redesign the page using CSS to lay out the
    > sections, and abandon the framesets.


    Or you wait until CSS7 with tframes. (0;
    Jan C. Faerber, Sep 7, 2009
    #9
  10. Charlie

    dorayme Guest

    In article <>,
    Sherm Pendley <> wrote:

    > Charlie <> writes:
    >
    > > I'm looking at a website that has a frameset of 3 frames, a banner at
    > > the top, a main content section and a navigation frame at the bottom.
    > > The banner has just the company logo in it, or on occasions it has
    > > contained just the name of the company in text format. This displays
    > > fine at the higher resolutions, but if you view the site at 1024x728,
    > > half of the logo/text is obscured at its bottom edge.

    >
    > Now you've discovered why it's a bad idea to hard-code the height of
    > the top banner frame - any particular size you choose will be a bad
    > choice for some users.
    >
    > So, stop doing that. Just let the top frame adjust itself to whatever
    > size best fits its contents.
    >


    Easier said than done with frames. Not so simple to specify the dims for:

    <frameset rows="*,*">
    <frame src="banner.html" name="banner">
    <frame src="content.html" name="content">
    </frameset>

    to match the natural way height is allotted for non-frame contexts like

    <div>...content...</div>
    <div>...other content...</div>

    <http://dorayme.netweaver.com.au/frames/frameset_rows.html>

    --
    dorayme
    dorayme, Sep 8, 2009
    #10
  11. Charlie wrote:
    > On 6 Sep, 21:06, Travis Newbury <> wrote:
    >> On Sep 6, 12:28 pm, Charlie <> wrote:
    >>
    >>> I've heard that conditional formatting has no place in purist HTML,
    >>> but I'm still keen to see if I can do the following.
    >>> I'd like a piece of text to be sized at 32 point at a screen
    >>> resolution of 1024x768, and 42 point at 1280x1024. Can this be done?

    >> What are you actually trying to do?

    >
    > I'm looking at a website that has a frameset of 3 frames, a banner at
    > the top, a main content section and a navigation frame at the bottom.
    > The banner has just the company logo in it, or on occasions it has
    > contained just the name of the company in text format. This displays
    > fine at the higher resolutions, but if you view the site at 1024x728,
    > half of the logo/text is obscured at its bottom edge. If I change it
    > to something smaller to accommodate the lower resolutions, it looks
    > feeble and silly at the higher ones. Hence the interest in doing
    > something conditional on resolution.


    Since the *pixel* height of the frame is the same in each case, why are
    you trying to size the text that, evidently, almost fills it vertically
    in points rather than in pixels? (Note that both frames and fixed-size
    fonts are both really disadvantageous in web design.)
    Harlan Messinger, Sep 8, 2009
    #11
  12. Jan C. Faerber, Sep 8, 2009
    #12
  13. Charlie

    dorayme Guest

    In article <>,
    Sherm Pendley <> wrote:

    > dorayme <> writes:
    >
    > > In article <>,
    > > Sherm Pendley <> wrote:
    > >
    > >> Now you've discovered why it's a bad idea to hard-code the height of
    > >> the top banner frame - any particular size you choose will be a bad
    > >> choice for some users.
    > >>
    > >> So, stop doing that. Just let the top frame adjust itself to whatever
    > >> size best fits its contents.

    > >
    > > Easier said than done with frames.

    >
    > So, he should stop doing frames too. :)
    >


    Indeed, as I said: "Perhaps avoid the problem altogether by having the
    banner a pic with a fixed height that informs how to set the top frame.
    Otherwise, just live with generous space. Or don't use frames!"

    --
    dorayme
    dorayme, Sep 8, 2009
    #13
  14. Charlie

    GTalbot Guest

    On 7 sep, 02:23, Charlie <> wrote:

    > here to ask the question and learn something.


    I believe the best policy is to not define any font-size for any
    textual elements. That way

    - the text will be resizable at will by the users/visitors in any/all
    browsers, if they need to resize the text size (low vision)
    - the accessibility feature of browsers regarding font-size will be
    already, by default, established, honored.
    E.g.: Tools/Internet Options.../Accessibility/Ignore font-size on
    webpages in Internet Explorer 7 and Internet Explorer 8 will be
    already working perfectly for your IE 7 and IE 8 users. What more can
    you ask?
    - the webpage will avoid each and all of the font-size unit problems
    or known bugs (px, em, ex) in browsers. What more could you ask for?
    - browser default font-size values for elements like h1, h2, ... p,
    div are now pretty much the same across browser manufacturers (at
    least in their recent releases: IE 8, Firefox 3.x, Opera 9+). So, why
    would you (or anyone) need to modify these values?

    More reading/learning:

    "
    Browsers allow the user to set a default font size which will be
    applied to any font that is not given an explicit size by the
    displayed page.(...)
    If you do not specify any font size at all (as on the pages you are
    reading), text will appear in the default size that was selected by
    the user. (...)
    "
    Truth & Consequences in web design: Font size by Chris Beal
    http://pages.prodigy.net/chris_beall/TC/Font size.html

    Let Users Control Font Size
    http://www.useit.com/alertbox/20020819.html

    Browser Defaults Are Not Too Big
    http://mrmazda.no-ip.com/auth/bigdefaults.html

    "
    How do site developers know what size my default is?
    They don't. They can't.
    "
    Web Browser Default Text Size
    http://mrmazda.no-ip.com/auth/defaultsize.html

    The 100% Easy-2-Read Standard
    http://informationarchitects.jp/100e2r/

    regards, Gérard
    --
    Internet Explorer 8 bugs: 56 bugs so far
    http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/
    Internet Explorer 7 bugs: 182 bugs so far
    http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/
    GTalbot, Sep 10, 2009
    #14
  15. Charlie

    Charlie Guest

    On 10 Sep, 01:01, GTalbot <> wrote:
    > On 7 sep, 02:23, Charlie <> wrote:
    >
    > > here to ask the question and learn something.

    >
    > I believe the best policy is to not define any font-size for any
    > textual elements. That way
    >
    > - the text will be resizable at will by the users/visitors in any/all
    > browsers, if they need to resize the text size (low vision)
    > - the accessibility feature of browsers regarding font-size will be
    > already, by default, established, honored.
    > E.g.: Tools/Internet Options.../Accessibility/Ignore font-size on
    > webpages in Internet Explorer 7 and Internet Explorer 8 will be
    > already working perfectly for your IE 7 and IE 8 users. What more can
    > you ask?
    > - the webpage will avoid each and all of the font-size unit problems
    > or known bugs (px, em, ex) in browsers. What more could you ask for?
    > - browser default font-size values for elements like h1, h2, ... p,
    > div are now pretty much the same across browser manufacturers (at
    > least in their recent releases: IE 8, Firefox 3.x, Opera 9+). So, why
    > would you (or anyone) need to modify these values?
    >
    > More reading/learning:
    >
    > "
    > Browsers allow the user to set a default font size which will be
    > applied to any font that is not given an explicit size by the
    > displayed page.(...)
    > If you do not specify any font size at all (as on the pages you are
    > reading), text will appear in the default size that was selected by
    > the user. (...)
    > "
    > Truth & Consequences in web design: Font size by Chris Bealhttp://pages.prodigy.net/chris_beall/TC/Fontsize.html
    >
    > Let Users Control Font Sizehttp://www.useit.com/alertbox/20020819.html
    >
    > Browser Defaults Are Not Too Bighttp://mrmazda.no-ip.com/auth/bigdefaults..html
    >
    > "
    > How do site developers know what size my default is?
    > They don't. They can't.
    > "
    > Web Browser Default Text Sizehttp://mrmazda.no-ip.com/auth/defaultsize.html
    >
    > The 100% Easy-2-Read Standardhttp://informationarchitects.jp/100e2r/
    >
    > regards, Gérard
    > --
    > Internet Explorer 8 bugs: 56 bugs so farhttp://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/
    > Internet Explorer 7 bugs: 182 bugs so farhttp://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/


    OK, many thanks to you all for your input. I will go away and apply
    the "best practice" recommended here. :)

    Charlie
    Charlie, Sep 10, 2009
    #15
  16. On Sep 10, 6:44 am, Charlie <> wrote:
    > OK, many thanks to you all for your input. I will go away and apply
    > the "best practice" recommended here. :)



    Please provide a URL to your site so we can make sure that you are
    using best practices. We don't take kindly to people that deceive us
    and tell us they will follow our advice then turn around and ignore it!
    Travis Newbury, Sep 10, 2009
    #16
  17. On Sep 8, 12:52 pm, Harlan Messinger
    <> wrote:
    > (Note that both frames and fixed-size
    > fonts are both really disadvantageous in web design.)


    As browsers advance this (font size) is becoming less important.
    Unlike older browser version that only increased the size of the text
    leaving the layout alone now expand everything on the page including
    the layout. So the old "large font screws up my layout" is really no
    longer as important as it use to be.

    As they continue to advance (the browsers) they will overcome many of
    the accessibility issues we find today.

    Please note, I am not disagreeing with your statement, only pointing
    out that it is becoming less important than it use to as browser
    technology progresses.
    Travis Newbury, Sep 10, 2009
    #17
  18. Charlie

    dorayme Guest

    In article
    <>,
    Travis Newbury <> wrote:

    > On Sep 8, 12:52 pm, Harlan Messinger
    > <> wrote:
    > > (Note that both frames and fixed-size
    > > fonts are both really disadvantageous in web design.)

    >
    > As browsers advance this (font size) is becoming less important.
    > Unlike older browser version that only increased the size of the text
    > leaving the layout alone now expand everything on the page including
    > the layout. So the old "large font screws up my layout" is really no
    > longer as important as it use to be.


    A while to go yet in the same way that there is a while to go on how
    better to help fractious nations like Iraq and Afghanistan without doing
    more harm than good.

    Let's suppose that pictures remain great when zoomed. Text too. But how
    are you going to stop me cursing when I have to scroll to see things and
    bits of things that already looked fine as they were except I just want
    the text bigger at an expected cost of more vertical scrolling at most.
    Why is it such progress when I have to work harder?

    --
    dorayme
    dorayme, Sep 10, 2009
    #18
  19. On Sep 10, 7:47 am, dorayme <> wrote:
    > But how
    > are you going to stop me cursing when I have to scroll to see things and
    > bits of things that already looked fine as they were except I just want
    > the text bigger at an expected cost of more vertical scrolling at most.


    I don' want you to stop cursing, I like it when you talk dirty...
    Travis Newbury, Sep 10, 2009
    #19
  20. On Sep 10, 7:47 am, dorayme <> wrote:
    > Let's suppose that pictures remain great when zoomed. Text too. But how
    > are you going to stop me cursing when I have to scroll to see things and
    > bits of things that already looked fine as they were except I just want
    > the text bigger at an expected cost of more vertical scrolling at most.
    > Why is it such progress when I have to work harder?


    Uh, since the browser is now the one that makes everything bigger
    rather than just the text, perhaps you need to talk to them.
    Travis Newbury, Sep 10, 2009
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Klemt
    Replies:
    6
    Views:
    11,053
    Peter Theill
    Nov 28, 2004
  2. dave richards
    Replies:
    2
    Views:
    608
    Paul Furman
    Feb 19, 2004
  3. Wongod
    Replies:
    2
    Views:
    707
  4. wial
    Replies:
    2
    Views:
    814
  5. mttc
    Replies:
    2
    Views:
    2,383
    Roedy Green
    Jul 3, 2009
Loading...

Share This Page