Does IE8 line-break on a hyphen?

502 Views Asked by At

I'm using the <wbr> tag to force firefox to line-break when a hyphenated word can't fit in the space remaining on a line (or row), but according to the quirksmode website IE8 doesn't respect this tag at all.

I can't check for myself, but what would IE8 do with the following markup? Assume that the column is 200px wide, font-size is 16px, and the hyphenated word can't fit .

<p>Blah, blah, blah, cloud-<wbr>based environment, blah, blah, blah.</p>

Here's an image to make things clearer, showing what happens in FF with and without the <wbr> tag.

enter image description here

I realise that IE8 will ignore the tag, but does it line-break on the hyphen like Chrome and Safari do?

2

There are 2 best solutions below

0
On BEST ANSWER

Yes, it does. You can check this in Internet Explorer by hitting F12, or by going to Tools > Developer Tools, then changing the Browser Mode and the Document Mode to IE8.

1
On

IE treats a hyphen as allowing a line break after it by default. This has been the IE behavior at least since IE 5. If you need to allow a line break in other contexts, then there are several approaches (which you might use in a combination), such as <wbr>, zero width space character, and hyphenation.