Log in

View Full Version : Break line on a long word



Schmoopy
04-10-2009, 12:53 PM
Hi, I'm having this problem where if someone puts in a string, for example "dposdpaosdapsodapsdoaspdoasdldasldasdpaosdpodssapdosamx", just random text - but all in one word, it goes off the div and I don't want to use overflow:auto; because it looks ugly with a scroll bar.

Here's some examples.

Normal:

normal.jpg (http://garlandsails.co.uk/images/normal.jpg)

No line break:

nobreak.jpg (http://garlandsails.co.uk/images/nobreak.jpg)

Any way to get around this?

Medyman
04-10-2009, 01:13 PM
In some browsers: http://www.w3.org/TR/css3-text/#word-wrap

Some browsers use "word-wrap" instead of "break-word", I think. At least, they used to.

Schmoopy
04-10-2009, 01:46 PM
Well luckily I'm making this specifically for firefox, but it doesn't recognise "word-wrap" as a property, anything else I could try?

Snookerman
04-10-2009, 02:46 PM
Take a look at this thread: http://www.dynamicdrive.com/forums/showthread.php?t=38363 (http://www.dynamicdrive.com/forums/showthread.php?t=38363)
Hope it helps.