Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>Soft hyphen</h2> <p>You can tell browsers where to split long words by inserting soft hyphen (<code>&amp;shy;</code>):</p> <pre><code>averyvery&amp;shy;longword </code></pre> <p>may be rendered as</p> <blockquote> <p>averyverylongword</p> </blockquote> <p>or</p> <blockquote> <p>averyvery-<br> longword</p> </blockquote> <p>A nice regular expression can ensure you won't be inserting them unless neccessary:</p> <pre><code>/([^\s-]{5})([^\s-]{5})/ → $1&amp;shy;$2 </code></pre> <p>Browsers and search engines are smart enough to ignore this character when searching text, and Chrome and Firefox (haven't tested others) ignore it when copying text to clipboard.</p> <h2><code>&lt;wbr&gt;</code> element</h2> <p>Another option is to inject <code>&lt;wbr&gt;</code>, a former <a href="http://www.quirksmode.org/oddsandends/wbr.html" rel="noreferrer">IE-ism</a>, which is now <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-wbr-element" rel="noreferrer">in HTML5</a>:</p> <pre><code>averyvery&lt;wbr&gt;longword </code></pre> <p>Breaks with no hyphen:</p> <blockquote> <p>averyvery<br> longword</p> </blockquote> <p>You can achieve the same with zero-width space character <code>&amp;#8203;</code> (or <code>&amp;#x200B</code>).</p> <hr> <p>FYI there's also <a href="http://www.w3.org/TR/css3-text/#hyphenation" rel="noreferrer">CSS <code>hyphens: auto</code></a> supported by latest IE, Firefox and Safari (<a href="http://caniuse.com/#feat=css-hyphens" rel="noreferrer">but currently not Chrome</a>):</p> <pre><code>div.breaking { hyphens: auto; } </code></pre> <p>However that hyphenation is based on a hyphenation dictionary and it's not guaranteed to break long words. It can make justified text prettier though.</p> <h2>Retro-whining solution</h2> <p><code>&lt;table&gt;</code> for layout is bad, but <code>display:table</code> on other elements is fine. It will be as quirky (and stretchy) as old-school tables:</p> <pre><code>div.breaking { display: table-cell; } </code></pre> <hr> <p><code>overflow</code> and <code>white-space: pre-wrap</code> answers below are good too.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload