Re: Constraining text within a border

Re: Constraining text within a border

am 09.04.2008 07:06:27 von a.nony.mous

Don W wrote:

> Is there a way to create a border of fixed height and width to constrain
> whatever text is within?

Using pixel measurements? No.

> If the text is only a few characters it should be rendered in a very
> large font. If there is a lot of text within the border, it should
> be rendered with a smaller font so that it fits within the border.

Use em units for sizing the

instead. Then when your visitor
increases hir font size, the box will increase along with it.

> I tried using a table and setting the height and width, but the
> browser seems to take this as nothing more than a suggestion. When
> there's a lot of text in a cell, it just widens the column for me.

That is how tables work. You can't stick fourteen eggs in a dozen-egg
box.

How about posting the URL to your sample page? It would make it much
easier to give advice, rather than just guessing at what you are trying
to do.

--
-bts
-Friends don't let friends drive Vista

Re: Constraining text within a border

am 09.04.2008 07:11:56 von rf

"Don W" wrote in
news:r6qdnQAo4dE91GHanZ2dnUVZ_t-nnZ2d@comcast.com:

> Is there a way to create a border of fixed height and width to
> constrain whatever text is within? If the text is only a few
> characters it should be rendered in a very large font. If there is a
> lot of text within the border, it should be rendered with a smaller
> font so that it fits within the border.

No.

Why do you want to do this?


> I tried using a table and setting the height and width, but the
> browser seems to take this as nothing more than a suggestion. When
> there's a lot of text in a cell, it just widens the column for me.

Correct, that is what is supposed to happen, unless you use CSS: table-
layout: fixed; but that is *not* going to change the text size based on
the amount of text for you.

--
Richard
Killing all threads involving google groups
The Usenet Improvement Project: http://improve-usenet.org

Constraining text within a border

am 09.04.2008 07:15:22 von Don W

Is there a way to create a border of fixed height and width to constrain
whatever text is within? If the text is only a few characters it should be
rendered in a very large font. If there is a lot of text within the border,
it should be rendered with a smaller font so that it fits within the border.

I tried using a table and setting the height and width, but the browser
seems to take this as nothing more than a suggestion. When there's a lot of
text in a cell, it just widens the column for me.

Don W.

Re: Constraining text within a border

am 09.04.2008 07:38:21 von Nik Coughlin

"Don W" wrote in message
news:r6qdnQAo4dE91GHanZ2dnUVZ_t-nnZ2d@comcast.com...
> Is there a way to create a border of fixed height and width to constrain
> whatever text is within? If the text is only a few characters it should
> be rendered in a very large font. If there is a lot of text within the
> border, it should be rendered with a smaller font so that it fits within
> the border.
>
> I tried using a table and setting the height and width, but the browser
> seems to take this as nothing more than a suggestion. When there's a lot
> of text in a cell, it just widens the column for me.
>
> Don W.

No way to do it just using html/css.

You can do this with JavaScript. Just make sure that the results are
acceptable with it turned off as well.

You can also do this in Flash. Use real text content initially, then remove
it with javascript and replace it with a Flash object instead. That way if
a user doesn't have Flash they get the plain text instead, as do search
engines. Again, make sure that the results are acceptable in this case.

Text replacement with Flash:
http://www.mikeindustries.com/blog/sifr/

Re: Constraining text within a border

am 09.04.2008 08:36:18 von Don W

"Beauregard T. Shagnasty" wrote in message
news:n9YKj.158412$cQ1.57393@bgtnsc04-news.ops.worldnet.att.n et...
> Don W wrote:
>
>> Is there a way to create a border of fixed height and width to constrain
>> whatever text is within?
>
> Using pixel measurements? No.
>
>> If the text is only a few characters it should be rendered in a very
>> large font. If there is a lot of text within the border, it should
>> be rendered with a smaller font so that it fits within the border.
>
> Use em units for sizing the

instead. Then when your visitor
> increases hir font size, the box will increase along with it.
>
>> I tried using a table and setting the height and width, but the
>> browser seems to take this as nothing more than a suggestion. When
>> there's a lot of text in a cell, it just widens the column for me.
>
> That is how tables work. You can't stick fourteen eggs in a dozen-egg
> box.
>
> How about posting the URL to your sample page? It would make it much
> easier to give advice, rather than just guessing at what you are trying
> to do.
>
> --
> -bts
> -Friends don't let friends drive Vista

Hey, thanks for the quick reply!

This page is not to be published. Actually, I need to print some placards
from a database and a browser seems like a good way to do that.

There are two sizes of placard I need to print -- 2 inches by 12 inches and
4 inches by 12 inches. Whatever text goes into those areas must fit in
those areas, so the font size should be adjusted accordingly. I was hoping
something like the 'max-width' attribute could help me accomplish this, but
it doesn't seem to work that way.

If there is a way to know how big the text will be when rendered, I can
adjust the font until it fits. Do you know of a way to do what I'm trying
to do?

Don W.

Re: Constraining text within a border

am 09.04.2008 09:25:13 von Don W

"Nik Coughlin" wrote in message
news:fthko6$hn1$1@aioe.org...
> "Don W" wrote in message
> news:r6qdnQAo4dE91GHanZ2dnUVZ_t-nnZ2d@comcast.com...
>> Is there a way to create a border of fixed height and width to constrain
>> whatever text is within? If the text is only a few characters it should
>> be rendered in a very large font. If there is a lot of text within the
>> border, it should be rendered with a smaller font so that it fits within
>> the border.
>>
>> I tried using a table and setting the height and width, but the browser
>> seems to take this as nothing more than a suggestion. When there's a lot
>> of text in a cell, it just widens the column for me.
>>
>> Don W.
>
> No way to do it just using html/css.
>
> You can do this with JavaScript. Just make sure that the results are
> acceptable with it turned off as well.
>
> You can also do this in Flash. Use real text content initially, then
> remove it with javascript and replace it with a Flash object instead.
> That way if a user doesn't have Flash they get the plain text instead, as
> do search engines. Again, make sure that the results are acceptable in
> this case.
>
> Text replacement with Flash:
> http://www.mikeindustries.com/blog/sifr/
>
>

This looks like what I need. I haven't done much in HTML, so it'll take me
a while to see what's involved here.

Thank you for the help!

Don W.

Re: Constraining text within a border

am 09.04.2008 15:45:03 von a.nony.mous

Don W wrote:

> This page is not to be published. Actually, I need to print some
> placards from a database and a browser seems like a good way to do
> that.

Ah. Well, browsers are not normally regarded as the best "programs for
printing."

> There are two sizes of placard I need to print -- 2 inches by 12
> inches and 4 inches by 12 inches. Whatever text goes into those
> areas must fit in those areas, so the font size should be adjusted
> accordingly. I was hoping something like the 'max-width' attribute
> could help me accomplish this, but it doesn't seem to work that way.

2 inches high by 12 inches wide? And nobody else will ever see it?

> If there is a way to know how big the text will be when rendered, I
> can adjust the font until it fits. Do you know of a way to do what
> I'm trying to do?

Sounds more like a job for either a word processor or a desktop
publishing application, not HTML and a browser.

And 12 inches ... do a landscape document on "legal size paper" and take
it to a bumper sticker printer. :-)

--
-bts
-Friends don't let friends drive Vista