Forum Moderators: not2easy

Message Too Old, No Replies

help! my overflowing text is not wrapping!

it's just carrying on horizontally forever!

         

HelenDev

3:08 pm on Oct 8, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The text in question is inside a div and here is the css for that div...


#rt {
text-align: right;
width: 25%;
padding-right: 5px;
float: right;
border-left: 1px solid #009966;
padding-left: 5px;
overflow: auto;
}

I put the overflow: auto in there to see if it would help - it doesn't - but I now have ugly scroll bars to highlight the problem in Mozilla. In IE my whole page gets screwed.

Any suggestions most gratefully received.

MozMan

4:29 pm on Oct 8, 2004 (gmt 0)

10+ Year Member



Try adding word-wrap. like this...

word-wrap: normal;

-or-

word-wrap: break-word;

one of those should fix it for you.

crashomon

4:41 pm on Oct 8, 2004 (gmt 0)

10+ Year Member



Have you declared the <div ID="rt"> because
<div class="rt"> won't work.

It works fine for me in IE 6 when I do that.

can you give the line of code that calls the div?

thanks,

patrick

nonstop

5:17 am on Oct 9, 2004 (gmt 0)

10+ Year Member Top Contributors Of The Month



has your text got breaking spaces in (not &nbsp)?

I had the same problem, when I removed the float
line it worked.

gohankid77

5:45 am on Oct 9, 2004 (gmt 0)

10+ Year Member



Sorry to disappoint you, but 'word-break' is only supported by IE5+ and only as an addition. It seems it will become a part of the CSS3 Recommendation.

[w3.org...]

HelenDev

8:55 am on Oct 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for your help guys :)

I realised that the problem was with a long email address - normal text with spaces is fine, but a long email address caused the problem.

I tried using word-wrap: break-word; and this solves the problem in ie6 but not in other browsers.

The div in question is part of a three column page layout. I'm only really hoping to make my pages totally right in ie5 and above - I merely expect them to be usable in other browsers - but I need this to work in ie5 and it doesn't appear to :(

In ie5 the word-wrap thing doesn't seem to work and my right hand column goes and sits underneath my other two columns if there is a long email address in here - is there anything I can do about this?

In mozilla the email address just sticks out of the div a bit which I can live with.

HelenDev

9:01 am on Oct 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perhaps my reply was a bit hasty - just been looking into these MS word breaking styles and found

word-break:break-all;

...the addition of which causes it to work in ie5 - whoo hoo!