Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>IE8/9 render the non-breaking hyphen mentioned in CanSpice's answer longer than a typical hyphen. It is the length of an en-dash instead of a typical hyphen. This display difference was a deal breaker for me.</p> <p>As I could not use the CSS answer specified by Deb I instead opted to use no break tags.</p> <pre><code>&lt;nobr&gt;e-mail&lt;/nobr&gt; </code></pre> <p>In addition I found a specific scenario that caused IE8/9 to break on a hyphen.</p> <ul> <li>A string contains words separated by non-breaking spaces - <code>&amp;nbsp;</code></li> <li>Width is limited</li> <li>Contains a dash</li> </ul> <p>IE renders it like this.</p> <p><img src="https://i.stack.imgur.com/Uxw7L.png" alt="Example of hyphen breaking in IE8/9"></p> <p>The following code reproduces the problem pictured above. I had to use a meta tag to force rendering to IE9 as IE10 has fixed the issue. No fiddle because it does not support meta tags.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=9" /&gt; &lt;meta charset="utf-8"/&gt; &lt;style&gt; body { padding: 20px; } div { width: 300px; border: 1px solid gray; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; &lt;p&gt;If&amp;nbsp;there&amp;nbsp;is&amp;nbsp;a&amp;nbsp;-&amp;nbsp;and&amp;nbsp;words&amp;nbsp;are&amp;nbsp;separated&amp;nbsp;by&amp;nbsp;the&amp;nbsp;whitespace&amp;nbsp;code&amp;nbsp;&amp;amp;nbsp;&amp;nbsp;then&amp;nbsp;IE&amp;nbsp;will&amp;nbsp;wrap&amp;nbsp;on&amp;nbsp;the&amp;nbsp;dash.&lt;/p&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    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. 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