Static Font Sizes

B

BGW

Hello-
I'm brand spankin' new to both these forums and HTML coding, so please
be gentle. . .

How can I create a static font size? I've got several tables(within
tables, withing tables. . .) on a page, and while my main text can be
viewed clearly regardless of whether the viewer has their browser font
size set to smallest or largest, I need to keep certain text a static
size so as to fit within a very specific area on screen. When I set
my browser to "smallest," the text has weird breaks in it, when I set
it to "largest," it oozes onto multiple lines with more weird breaks
(my boss wants it on two lines, and two lines only!!!).

I'm programming with Arachnophilia, and am operating on about a third
grade level =P, so any assistance would be very much appreciated.

tia,
-bgw
 
M

Matthias Gutfeldt

BGW said:
Hello-
I'm brand spankin' new to both these forums and HTML coding, so please
be gentle. . .

OK, we'll let the white-hot iron cool off for a full three seconds.
We're soft like that.

How can I create a static font size?
(my boss wants it on two lines, and two lines only!!!).

You shouldn't do this terrible thing to your poor unsuspecting visitors!
But if you must, you can indeed try to make it more inconvenient for
your users to resize the font-size and force a certain text-flow onto
them. Here's a solution that might work in some CSS-aware browsers:

<p style="font-size:10px; white-space:nowrap">I should know better but
this is <br>a 10px text distributed over two lines.</p>

Ideally you'd put the style in an embedded or linked stylesheet, but
since you're using nested tables, it really doesn't matter one way or
the other.


Matthias
 
P

PeterMcC

BGW said:
Hello-
I'm brand spankin' new to both these forums and HTML coding, so please
be gentle. . .

How can I create a static font size? I've got several tables(within
tables, withing tables. . .) on a page, and while my main text can be
viewed clearly regardless of whether the viewer has their browser font
size set to smallest or largest, I need to keep certain text a static
size so as to fit within a very specific area on screen. When I set
my browser to "smallest," the text has weird breaks in it, when I set
it to "largest," it oozes onto multiple lines with more weird breaks
(my boss wants it on two lines, and two lines only!!!).

I'm programming with Arachnophilia, and am operating on about a third
grade level =P, so any assistance would be very much appreciated.

To set the font size use px - for instance the following would fix the
contents of the span at10px
<span style="font-size: 10px">Contents</span>

BUT

This is a *very* bad thing to do - tell your boss and quote the other
responses that this thread will surely bring when you're telling him/her.

The reason people use "larger" or "largest" is because they can't read the
text at the normal size - you will ensure that these people can't read your
web pages if you make it so that they can't use their resize option. It is
worth noting that it is *their* resize option and designers have no business
messing with visitors browser functionality.

And it's not just those with a visual handicap - look at the size of a pixel
on a 640x480 monitor and then look at a pixel on a 1600x1200 screen -
there's almost a 3-to-1 proportional difference. Make the text the right
size for a 1600x1200 screen and it's 3 times too big on a 480x640 screen;
make it right for the 640x480 screen and it's now unreadably small on the
1600x1200.

Alternatively, don't fix the size and work on the basis that the user knows
better than the designer what size is comfortable for them to read.

So, ask the boss which they'd prefer - text that fits on two lines or text
that is readable - it's a simple enough choice. And, if they get the answer
wrong, you could mention that the accessibility issue can, in the right
circumstances, put the site on the wrong side of the law. In the US, for
instance, see http://www.humanfactors.com/downloads/thelaw.asp - and run
this quote from that page past them "It should be noted that organizations
concerned with various disabilities have filed lawsuits against commercial
entities over the issue of Web accessibility."

Use % or ems and your text will resize in proportion to the user's
preference - 100% is the default to which they've set their browser so
larger text is a set at, say, 120% and T&C stuff can go to 90%... The em is
sized at the visitors browser setting, so 1.2 em =120% and so on.

BTW - I do appreciate that you're just the messenger - it's not supposed to
be a rant at you :) Best of luck with the boss.
 
P

PeterMcC

BGW said:
Aw gee. . .make a girl blush! = )

It's not for the body text - it's for a sort-of logo. . .
You could alsways do it as a graphic with appropriate alt text for those who
don't see graphics.
 
B

BGW

So, ask the boss which they'd prefer - text that fits on two lines or text
that is readable - it's a simple enough choice. And, if they get the answer
wrong, you could mention that the accessibility issue can, in the right
circumstances, put the site on the wrong side of the law. In the US, for
instance, see http://www.humanfactors.com/downloads/thelaw.asp - and run
this quote from that page past them "It should be noted that organizations
concerned with various disabilities have filed lawsuits against commercial
entities over the issue of Web accessibility."

Use % or ems and your text will resize in proportion to the user's
preference - 100% is the default to which they've set their browser so
larger text is a set at, say, 120% and T&C stuff can go to 90%... The em is
sized at the visitors browser setting, so 1.2 em =120% and so on.

BTW - I do appreciate that you're just the messenger - it's not supposed to
be a rant at you :) Best of luck with the boss.

I agree with you. For the rest of the site, I'm only using %, and
trying to map out the text so that enlarging it doesn't whack-out the
rest of the cisual. . .

My boss is. . .well, she has a visual "ideal" and absolutely no
technical expertise whatsoever. . . so the project is getting funner
and funner as I inch closer and closer to the far extremities of my
capability. . . the only way to keep a step ahead is through the
assistance of you fine technically supportive people. . .

Thanks for all the help!! = )
 
J

Jacqui or (maybe) Pete

It's not for the body text - it's for a sort-of logo. . .
....
px sizing for fonts is only useful for lining text up with images [1],
so it seems a reasonable to use that method for a logo (at least no
worse than using an image, which is the usual way).

[1] except that some browsers resize px-sized text without resizing
images, which IMHO is a bug.
 
M

Matthias Gutfeldt

BGW said:
It's not for the body text - it's for a sort-of logo. . .

Ah! OK! A logo should always look the same. For logos, even if they're
just sort-of, the usual solution is an image, because (as you might have
noted in this thread) you don't have control over appearances if you use
HTML&CSS. Create an IMAGE of the text, in the right font, the right
size, color, whatever special effects that logo needs. And of course
don't forget to supply the appropriate ALT and/or TITLE attribute values.

I'm not really CSS-savvy. . . can I just pop that code into my HTML
code, even if I'm not using CSS (yet - working on the learnin')?

Yes. Just copy&paste the paragraph into your HTML code. You can replace
the Paragraph element with whatever other element you had in mind.


Matthias
 

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,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top