Forum Moderators: not2easy

Message Too Old, No Replies

how to force text to wrap?

it's getting out of its box

         

muszek

12:30 am on Dec 10, 2004 (gmt 0)

10+ Year Member



I have a small div box, let's say 300px and it contains a URL which is dynamically generated, so I can't be sure it will always fit. And when it doesn't fit, in Opera and Firefox it breaks through right border of this box (which looks nasty). It wraps nicely in IE 6 (nice surprise).

How could I wrap it? It doesn't have any spaces.

DrDoc

12:41 am on Dec 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...put spaces in it? Or, truncate it after X characters?

Storyman

1:15 am on Dec 10, 2004 (gmt 0)

10+ Year Member



muszek,

Have you considered chopping up the url and posting the first x number of characters in domain name as the link, then dynamicaly creating the <a href link.

You then won't have to worry about the length of the URL.

muszek

3:03 pm on Dec 10, 2004 (gmt 0)

10+ Year Member



the point is that it's supposed to be an URL that user copies and pastes to a friend. it's not a clickable link. I can't really mess it up with spaces etc.

DrDoc

3:37 pm on Dec 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Then, use an input field that is as wide as the div, remove borders... Tadaa! You've got a one-line-scroll :) (without the scroll bars of course)

adni18

3:55 pm on Dec 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



word-wrap:break-word

DrDoc

4:52 pm on Dec 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



word-wrap:break-word

Duh! You're right... That would work too :)
Thanks ;)

That's by far the best solution... provided your visitors have at least semi recent browsers.

kk5st

9:03 pm on Dec 10, 2004 (gmt 0)

10+ Year Member



Would not

{overflow: auto;}

work as well?

cheers,

gary