Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / CSS / September 2004



Tip: Looking for answers? Try searching our database.

To change automatically the text size

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter - 29 Sep 2004 10:28 GMT
Hi at all,
how can I do to make a css file to change automatically the text size of the
text that is into a table relatively the screen size?

I.E. if the screen is 800 x I want the text size=10pt but if it is 1024 I
want the text size =12 pt.
Thank in advance
Peter
Mark Tranchant - 29 Sep 2004 10:44 GMT
> how can I do to make a css file to change automatically the text size of the
> text that is into a table relatively the screen size?

> I.E. if the screen is 800 x I want the text size=10pt but if it is 1024 I
> want the text size =12 pt.

I don't know where to start.

1) *You* may want the font that size, but what about the user of your
site? He or she may use a larger screen to fit more information on, and
you are undoing their wishes.

pt is a particularly illogical choice for screen display, as it is a
physical measurement (72pt = 1 inch). What does that mean for your fonts
on a 3" PDA screen or a 90" projection screen? How do you even know the
physical size of the viewing area?

Don't set absolute font sizes, but use relative sizing with 100% as the
main content text size. That way, the user gets the font size (s)he wants.

2) Screen width is not the same as browser window width. The user may
want to use a large screen to have multiple windows side by side.

3) Don't use tables for layout.

Having said all of that, there is a great article on a method to adapt
layout to browser window width using Javascript DOM manipulation. This
isn't guaranteed to work all the time on all browsers, but is a nice
enhancement:

http://www.themaninblue.com/writing/perspective/2004/09/21/

I use this on my latest site project:

http://step-by-step.org.uk/

If you reduce the window width below about 700px, the header layout
changes, the menu bar shrinks and the text in the table on the
"Prospectus" page shrinks.

Use with care and thought. Modifying font sizes can cause real
accessibility issues.

Signature

Mark.
http://tranchant.plus.com/

Philip Ronan - 29 Sep 2004 10:45 GMT
> Hi at all,
> how can I do to make a css file to change automatically the text size of the
[quoted text clipped - 4 lines]
> Thank in advance
> Peter

What do you want to do that for?!?

Even if you *do* know what the screen size is, that still doesn't tell you
how large it is. I've got a 17 inch monitor here. At the moment it's set to
1280x1024, but with a click of the mouse I could change that to anywhere
between 640x480 and 1600x1200. But it will still measure 17 inches.

Here's a novel idea: set the text size to 100% and let your visitors choose
a size that suits them.

Meddling about with text sizes in the way you described is not going to
improve your website one tiny bit. Trust me on that.

Phil

Signature

Philip Ronan
phil.ronanzzz@virgin.net
(Please remove the "z"s if replying by email)

Wes Groleau - 29 Sep 2004 18:45 GMT
> Here's a novel idea: set the text size to 100% and let your visitors choose
> a size that suits them.

I have used a browser that thinks 100% means the
full width of the screen, no matter what the browser
window size is.  (It was either Opera or Netscape,
about four years ago.)

Signature

Wes Groleau

   Measure with a micrometer, mark with chalk, and cut with an axe.

Harlan Messinger - 29 Sep 2004 19:42 GMT
> > Here's a novel idea: set the text size to 100% and let your visitors choose
> > a size that suits them.
[quoted text clipped - 3 lines]
> window size is.  (It was either Opera or Netscape,
> about four years ago.)

What happened years ago on old, buggy browsers doesn't really weigh very
high in comparison with good design practices.
Andrew Thompson - 29 Sep 2004 11:10 GMT
> I.E. if the screen is 800 x I want the text size=10pt

If it is your browser, set font size at 100% and use
the 'text zoom' feature to increase size.  ..And if
it is *my* browser, don't presume I have it full screen.

Signature

Andrew Thompson
http://www.PhySci.org/codes/  Web & IT Help
http://www.PhySci.org/  Open-source software suite
http://www.1point1C.org/  Science & Technology
http://www.lensescapes.com/  Images that escape the mundane

Harlan Messinger - 29 Sep 2004 11:57 GMT
>Hi at all,
>how can I do to make a css file to change automatically the text size of the
>text that is into a table relatively the screen size?
>
>I.E. if the screen is 800 x I want the text size=10pt but if it is 1024 I
>want the text size =12 pt.

That's why you should use font-size: 100% and let the user decide what
his actual font size should be.

Signature

Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.