How Can I Controll Text Size on My Website?

V

vunet.us

We know that users have an ability to set a large or small text size
in their browsers. WHat is the way, however, to display certain web
content with a font's fixed size, no matter what settings are used by
a user's browser? Thanks.
 
B

Ben C

We know that users have an ability to set a large or small text size
in their browsers. WHat is the way, however, to display certain web
content with a font's fixed size, no matter what settings are used by
a user's browser? Thanks.

You can set font size with the font-size property to an absolute pixel
size.

Of course the users can still override that, and why shouldn't they.

If you must have the last word, I suppose you could render your text to
an image and use that. Some of the csszengarden pages do that, mainly so
they can use fancy fonts, e.g.

http://www.csszengarden.com/?cssfile=/122/122.css

"The Road to Englightenment" etc. are all images.
 
H

Harlan Messinger

We know that users have an ability to set a large or small text size
in their browsers. WHat is the way, however, to display certain web
content with a font's fixed size, no matter what settings are used by
a user's browser? Thanks.

The way to restrict use of your site to people with good vision is to
use CSS such as the following:

font-size: 6pt;

Even then, if they have a zoom tool, the people you're trying to spite
will be able to read your site anyway. You might get better selectivity
if your text is in light gray on a medium gray background.
 
V

vunet.us

You can set font size with the font-size property to an absolute pixel
size.

Of course the users can still override that, and why shouldn't they.

If you must have the last word, I suppose you could render your text to
an image and use that. Some of the csszengarden pages do that, mainly so
they can use fancy fonts, e.g.

http://www.csszengarden.com/?cssfile=/122/122.css

"The Road to Englightenment" etc. are all images.

My web application needs a text size control in one place. I tested
IE7, set pixels keep the size in control unless an option "Ignore Font
Sizes..." checked in the browser. But FF2 behaves differently: it
always increases the size despite the pixels in CSS.
So, there is no ultimate solution other than what was mentioned?
 
S

SpaceGirl

My web application needs a text size control in one place. I tested
IE7, set pixels keep the size in control unless an option "Ignore Font
Sizes..." checked in the browser. But FF2 behaves differently: it
always increases the size despite the pixels in CSS.
So, there is no ultimate solution other than what was mentioned?

Render your text in Flash (or the entire page/site).
 
T

Toby A Inkster

vunet.us said:
We know that users have an ability to set a large or small text size
in their browsers. WHat is the way, however, to display certain web
content with a font's fixed size, no matter what settings are used by
a user's browser? Thanks.

Why would you *want* to do this? If I want to read your text in a larger
font, why would you want to stop me?

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
 
J

Jonathan N. Little

My web application needs a text size control in one place. I tested
IE7, set pixels keep the size in control unless an option "Ignore Font
Sizes..." checked in the browser. But FF2 behaves differently: it
always increases the size despite the pixels in CSS.
So, there is no ultimate solution other than what was mentioned?
Maybe you are approaching the problem from the redirection. Most likely
your are trying to fit text within a fix block set in pixels. Instead of
trying to fix the text to the pixels, define the box in a dimension that
is proportional to the font:

..pigeonHoled { width: 10em; height: 5em; }

the block will now scale with respect to the font.

BTW your original approach of "fixing the font" may also fail because
the visitor does not have the font that you are using and what is
substituted has different proportion or kerning...
 
T

Toby A Inkster

Ben said:
If you must have the last word, I suppose you could render your text to
an image and use that.

Such font sizes are still variable. The font will appear larger on my 17"
desktop screen than it would on my 12" laptop screen.

--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
 
B

Ben C

Such font sizes are still variable. The font will appear larger on my 17"
desktop screen than it would on my 12" laptop screen.

In centimetres, yes, but not in pixels?

To have total control over both is very hard. I think the OP wanted to
control the pixels.
 
A

Andy Dingley

My web application needs a text size control in one place.

That's nice. I bet your users don't.

Allowing your users to control things is _good_. Don't fight it.
 
E

Ed Seedhouse

We know that users have an ability to set a large or small text size
in their browsers. WHat is the way, however, to display certain web
content with a font's fixed size, no matter what settings are used by
a user's browser? Thanks.

That would be no way at all. THE WEB IS NOT PAPER!!! That's just a
fact and the sooner you understand it the sooner you will be able to
design web sites that are not junk. Nothing you can do will change the
facts.
 
J

Jonathan N. Little

Ben said:
In centimetres, yes, but not in pixels?

Ah no, both are dependent on physical monitor size and current resolution...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-language" content="en-us">

<title>Dims</title>

<style type="text/css">
div { margin: 1em; color: white; background-color: black; }
div.cm { width:5cm; height:5cm; }
div.in { width:2in; height:2in; }
div.px { width: 200px; height:220px; }
</style>
</head>
<body>
<div class="cm">5 cm sq</div>
<div class="in">2 in sq</div>
<div class="in">200 px sq</div>
</body>
</html>
 
E

Ed Seedhouse

You can set font size with the font-size property to an absolute pixel
size.

Of course the users can still override that, and why shouldn't they.

If you must have the last word, I suppose you could render your text to
an image and use that.

But of course with Opera and IE7 users can resize "such" text anyway.

The Web is NOT paper. Nothing you or I can do will make it into paper.
TV is not Radio, period, and the Web is not paper, period.
 
J

John Hosking

Ben said:
In centimetres, yes, but not in pixels?

Depends on the browser (version), as Opera-using Toby surely knows.
To have total control over both is very hard. I think the OP wanted to
control the pixels.

Me, too (I mean, about controlling the pixels, not the other thing :p).
But we don't know why the OP thinks that, or what the OP's putative
restrictions are.
 
B

Ben C

Ah no, both are dependent on physical monitor size and current resolution...

I suppose this depends on what you mean by a pixel. A monitor might have
1280x1024 pixels but the graphics card might be working to 640x512.
It's the graphics card pixels that CSS things are sized to, which you
can measure with KRuler, but not with a real ruler, or by counting
screen pixels while looking through a physical magnifiying glass.

Or am I missing another level of subtlety somewhere?
 
B

Ben C

I suppose this depends on what you mean by a pixel. A monitor might have
1280x1024 pixels but the graphics card might be working to 640x512.
It's the graphics card pixels that CSS things are sized to, which you
can measure with KRuler, but not with a real ruler, or by counting
screen pixels while looking through a physical magnifiying glass.

Sorry, rather ambiguous, I meant "nor" not "or".
 
J

Jonathan N. Little

Ben said:
Sorry, rather ambiguous, I meant "nor" not "or".

When one specifies pixels in a stylesheet of course is the "apparent"
pixel on the monitor. Depending on the screen resolution the "displayed
pixel" will be made up of more than one physical phosphor (CRT bias)
pixel, it should anyway unless you have a really crappy monitor.

But my point was regardless whether you use "px", or "physical units"
like "cm" or "in" in your stylesheet the size of the element on the
screen when you slap a ruler to it will vary depending on the monitor
and the user resolution settings. The "physical units", cm, in, pt,
ft... only make sense when you are printing the page.
 
V

vunet.us

When one specifies pixels in a stylesheet of course is the "apparent"
pixel on the monitor. Depending on the screen resolution the "displayed
pixel" will be made up of more than one physical phosphor (CRT bias)
pixel, it should anyway unless you have a really crappy monitor.

But my point was regardless whether you use "px", or "physical units"
like "cm" or "in" in your stylesheet the size of the element on the
screen when you slap a ruler to it will vary depending on the monitor
and the user resolution settings. The "physical units", cm, in, pt,
ft... only make sense when you are printing the page.

Many thanks to all of you for the input.
 
D

dorayme

Ben C said:
or by counting
screen pixels while looking through a physical magnifiying glass.

I used to do this with a Mac SE when programming in QuickBasic. I
think they were a bit square?
 
N

Neo Geshel

We know that users have an ability to set a large or small text size
in their browsers. WHat is the way, however, to display certain web
content with a font's fixed size, no matter what settings are used by
a user's browser? Thanks.

To fix a user’s font size is to fail to understand the basic nature of
the Internet. The user’s method of viewing your web site shouldn’t
matter - the content should be equally accessible no matter what device
they use and what font size, or if images are turned off, etc., etc..

And Accessibility is a big issue. While you wouldn’t normally consider
my father to be “disabled†- he can read just fine with a pair of
reading glasses and his arms outstretched - he is considered disabled
when it comes to web usability. For him to read a site with small-ish
text (or text that can be resized) is like for one of us to read a
newspaper with text only 3 mm tall. It becomes very hard and very
frustrating.

Reconsider your attempt to permanently fix fonts to a specific size. Not
only can other browsers get around this (Firefox ignores it, and Opera
can zoom in), but creating a liquid or text-size-insensitive layout will
benefit you in the future when different display devices come out.

Yes, it is harder to do, but it is well worth the effort.

I hope this helps.
...Geshel
--
*********************************************************************
My return e-mail address is an automatically monitored spam honeypot.
Do not send e-mail there unless you wish to be reported as a spammer.
Please send all e-mail to my first name at my last name dot org, with
a subject-line of “NEWSGROUP REPLY FOR NEO GESHEL†(all uppercase).
*********************************************************************
 

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

Forum statistics

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

Latest Threads

Top