Best approach to break long strings?


I’ve read a couple of things about how to handle long strings so they break to stay whithin their container.

What do you gurus do in such situations?


-jj. :slight_smile:

The quick and dirty version: don’t have long strings. That’s the long clean version, too. Just exactly what are and from where cometh these long strings? If they are really integral pieces of the page’s content, the design process should have allowed for them.

Please show us some specimen content that contains overly long strings. I have no doubt that one or another of us will have a specific suggestion.



Originally an IE specific property but it is now a valid CSS3 property too.


Should work for you with most all current browsers as well as legacy IE

Oops! I had forgot that, Ray. I am still curious why long strings would rear their heads without having been considered in the development of the text blocks that contain them. (?)



Yeah, worked like a charm.

Long string of characters such as whole font chars. Length can vary.

I’m running slow tonight. Can you clarify for me?



Oh sorry. If you want to display fonts you created, you may have long strings.

Anyway, word-wrap:break-word; does not work as expected in opera, which is looking for a white space to break…

So I’m back at square one.

It works fine in latest opera as far as I can tell. What is the exact structure that you are having trouble with ?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
.test {
    border:1px solid #000
<div class="test">jlkjllllllllpouo9uporpnlyfkdffvyhvbttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt</div>

Hello Paul,

Thanks for your reply. :slight_smile:

I upgraded Opera and the problem is now fixed.