wrapping in a DIV
Posted: 03 March 2006 09:13 PM   [ Ignore ]
Newbie
Rank
Total Posts:  4
Joined  2006-03-01

Hi
Could anyone tell me how to style a DIV element so that its text content wraps, even when the text includes no spaces? E.g.

<div style=“width:20px;”>
contentcontentcontentcontentcontentcontentcontentcontent
</div>

Thanx for any help!

Profile
 
 
Posted: 11 March 2006 04:02 PM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  1
Joined  2006-03-11

Hi -

I can’t believe that you want the content to wrap after only 20px, but anyway, here are two possible solutions:

<div style=“width:20px; word-wrap:break-word;”>
contentcontentcontentcontentcontentcontentcontentcontent
</div>

<div style=“width:20px; overflow-x:scroll;”>
contentcontentcontentcontentcontentcontentcontentcontent
</div>

They both look kind of funny at that width, but the first one is most likely what you’re looking for.

Profile
 
 
Posted: 14 March 2006 05:36 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  4
Joined  2006-03-01

Hi
Thank you for the reply.

Haha yes, 20px was just to kinda make the point!

The first one didn’t work in Firefox, but worked great In WinIE6.

Thanx

Profile