473,549 Members | 2,543 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 20 '05 #1
9 7676
On 29/9/04 10:28 am, Peter wrote:
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


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
ph***********@v irgin.net
(Please remove the "z"s if replying by email)
Jul 20 '05 #2
Peter wrote:
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/...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/
Jul 20 '05 #3
On Wed, 29 Sep 2004 09:28:36 GMT, Peter wrote:
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.

--
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
Jul 20 '05 #4
"Peter" <NO****@libero. it> wrote:
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.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #5
Peter <NO****@libero. it>:

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.


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.
Jul 20 '05 #6
Philip Ronan wrote:
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.)
--
Wes Groleau

Measure with a micrometer, mark with chalk, and cut with an axe.
Jul 20 '05 #7

"Wes Groleau" <gr**********@f reeshell.org> wrote in message
news:3L******** ************@gb ronline.com...
Philip Ronan wrote:
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.)


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

Jul 20 '05 #8
Wes Groleau <gr**********@f reeshell.org>:
Philip Ronan wrote:
set the text size to 100%
I have used a browser that thinks 100% means the
full width of the screen, no matter what the browser
window size is.


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


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
Jul 20 '05 #9
Christoph Paeper wrote:
Wes Groleau <gr**********@f reeshell.org>:
Philip Ronan wrote:
set the text size to 100%


I have used a browser that thinks 100% means the
full width of the screen, no matter what the browser
window size is.


Maybe for box dimensions, but certainly (I hope) not for font-sizes or
line-heights.


oops, that's really a bad case of tunnel vision!
(It was either Opera or Netscape, about four years ago.)


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
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
9556
by: Csaba2000 | last post by:
How do I detect when the font size has been changed (especially by user action: either Ctrl+Scroll wheel or View/Text Size)? This is just for use on IE 5.5+, but it would be great if there was a generic solution. Thanks, Csaba Gabor from New York
8
2222
by: netsurfer | last post by:
Hi: Have a question on making the date automatically filled in by what the user enters in by the date at the top. The date entered at the top would most likely be on a Wednesday then I need to have all the prior dates pop in. Example: User enters 2/9/05 in the date field at the top being a Wednesday...I need the dates at the bottom to...
2
3011
by: Adam | last post by:
I am importing a table from Informix into Access XP via an ODBC connection. In one of the fields, I will need it to allow 4000 characters. In Access help, it shows the data type can be changed to "memo" and that will allow up to 65,535 characters. After importing the table, I checked the data type and it automatically was set to memo, but...
2
3358
by: Tor Inge Rislaa | last post by:
How to change row height in a DataGrid I have DataGrid that is filled with data from a table in a DataSet. The content of the cells is text of more than one line (as a note field). What I want is to set the height of the row based on the number of lines in it. The row height of each row in the table may be different from each other. Is...
4
6252
by: Andre Nogueira | last post by:
hi there. I am creating a tabcontrol where the drawing of the tabs is controlled by me. However, i cannot find a way to change the lenght of the tab. For instance, "String" needs a smaller tab than a tab which text is "this is a tab with a really really long text". How can this be done, the changing of the width of the tab? Thanks! André...
3
2735
by: Stephen V | last post by:
Can anyone help me out with this problem. I would like to redirect/ go to another php page when my SQL insertion is done and also send a variable at the same time. the idea is, to come on my page for the first time and not doing anything, then I fill up my form and insert the data (with the button "add request" and when the oci_execute is...
25
30838
by: Peng Yu | last post by:
Hi, It is possible to change the length of "\t" to a number other than 8. std::cout << "\t"; Thanks, Peng
5
3050
by: _Who | last post by:
I spent all day yesterday trying different things. Something has happened so I can't change font size. I have a table and in the first cell I have only text. I tried using the cell's Style to change the font size. I tried using the cell's attribute to change the font size. I tried adding a paragraph element and doing the above to it....
0
7532
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7730
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7971
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7491
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5101
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3491
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1068
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.