Conditional formatting for font size?

C

Charlie

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
 
J

Jukka K. Korpela

Charlie said:
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.
 
A

Andy Dingley

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.
 
T

Travis Newbury

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?
 
C

Charlie

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


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

But it's a clueless idea.

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.
 
C

Charlie

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
 
J

Jan C. Faerber

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
 
D

Doug Miller

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.
 
J

Jan C. Faerber

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;
 
D

dorayme

Sherm Pendley said:
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>
 
H

Harlan Messinger

Charlie said:
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.)
 
D

dorayme

Sherm Pendley said:
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!"
 
G

GTalbot

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
 
C

Charlie

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

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

Charlie
 
T

Travis Newbury

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!
 
T

Travis Newbury

(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.
 
D

dorayme

Travis Newbury said:
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?
 
T

Travis Newbury

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...
 
T

Travis Newbury

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top