Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 21st, 2005, 12:53 AM
Peter
Guest
 
Posts: n/a
Default To change automatically the text size

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


  #2  
Old July 21st, 2005, 12:53 AM
Philip Ronan
Guest
 
Posts: n/a
Default Re: To change automatically the text size

On 29/9/04 10:28 am, Peter wrote:
[color=blue]
> 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[/color]

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

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


  #3  
Old July 21st, 2005, 12:53 AM
Mark Tranchant
Guest
 
Posts: n/a
Default Re: To change automatically the text size

Peter wrote:
[color=blue]
> 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?[/color]
[color=blue]
> 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.[/color]

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/...ve/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.

--
Mark.
http://tranchant.plus.com/
  #4  
Old July 21st, 2005, 12:53 AM
Andrew Thompson
Guest
 
Posts: n/a
Default Re: To change automatically the text size

On Wed, 29 Sep 2004 09:28:36 GMT, Peter wrote:
[color=blue]
> I.E. if the screen is 800 x I want the text size=10pt[/color]

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.

--
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
  #5  
Old July 21st, 2005, 12:53 AM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: To change automatically the text size

"Peter" <NOSPAM@libero.it> wrote:
[color=blue]
>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.[/color]

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

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ๔ter le premier point de mon adresse de courriel.
  #6  
Old July 21st, 2005, 12:53 AM
Christoph Paeper
Guest
 
Posts: n/a
Default Re: To change automatically the text size

Peter <NOSPAM@libero.it>:[color=blue]
>
> 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.[/color]

In your Opera 7 user stylesheet:

body {font-size: 100%}
@media screen and (min-width: 800px) {
body {font-size: 10pt}
}
@media projection, screen and (min-width: 1024px) {
/*Note, that the width requirement only applies to 'screen' here.*/
body {font-size: 12pt}
}

See <http://www.w3.org/TR/css3-mediaqueries/#width>.
There's also 'min-device-width' and 'max-device-width', if you really
meant them and not the viewport-width.

Don't use this on the author side in the WWW, except when you exactly know
what you are doing! You, Peter, are obviously not (yet) that experienced.

--
Useless Fact #12:
The national anthem of Greece has 158 verses.
  #7  
Old July 21st, 2005, 12:53 AM
Wes Groleau
Guest
 
Posts: n/a
Default Re: To change automatically the text size

Philip Ronan wrote:[color=blue]
> Here's a novel idea: set the text size to 100% and let your visitors choose
> a size that suits them.[/color]

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


--
Wes Groleau

Measure with a micrometer, mark with chalk, and cut with an axe.
  #8  
Old July 21st, 2005, 12:54 AM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: To change automatically the text size


"Wes Groleau" <groleau+news@freeshell.org> wrote in message
news:3LSdnS6C-9syacfcRVn-sA@gbronline.com...[color=blue]
> Philip Ronan wrote:[color=green]
> > Here's a novel idea: set the text size to 100% and let your visitors[/color][/color]
choose[color=blue][color=green]
> > a size that suits them.[/color]
>
> 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.)[/color]

What happened years ago on old, buggy browsers doesn't really weigh very
high in comparison with good design practices.

  #9  
Old July 21st, 2005, 12:54 AM
Christoph Paeper
Guest
 
Posts: n/a
Default Re: To change automatically the text size

Wes Groleau <groleau+news@freeshell.org>:[color=blue]
> Philip Ronan wrote:
>[color=green]
>> set the text size to 100%[/color]
>
> I have used a browser that thinks 100% means the
> full width of the screen, no matter what the browser
> window size is.[/color]

Maybe for box dimensions, but certainly (I hope) not for font-sizes or
line-heights.
[color=blue]
> (It was either Opera or Netscape, about four years ago.)[/color]

I'm *very* sure it was not Opera and not one of the later NS4s (4.5+).

--
"If you can't convince them, confuse them."
Harry S. Truman
  #10  
Old July 21st, 2005, 12:57 AM
Wes Groleau
Guest
 
Posts: n/a
Default Re: To change automatically the text size

Christoph Paeper wrote:
[color=blue]
> Wes Groleau <groleau+news@freeshell.org>:
>[color=green]
>> Philip Ronan wrote:
>>[color=darkred]
>>> set the text size to 100%[/color]
>>
>> I have used a browser that thinks 100% means the
>> full width of the screen, no matter what the browser
>> window size is.[/color]
>
> Maybe for box dimensions, but certainly (I hope) not for font-sizes or
> line-heights.[/color]

oops, that's really a bad case of tunnel vision!
[color=blue][color=green]
>> (It was either Opera or Netscape, about four years ago.)[/color][/color]

I dug around in my mental files and recalled that
it was some version of Opera, and it was only on
tables--body text correctly fit the window.

--
Wes Groleau

Those who make peaceful revolution impossible
will make violent revolution inevitable.
-- John F. Kennedy
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles