When applying the white-space: nowrap
property to all children of an element, an issue arises in Webkit (and blink) where white space doesn't break between elements as expected:
.pairs {
width: 180px;
overflow: hidden;
}
.pairs > span {
white-space: nowrap;
}
<div class="pairs">
<span>
<strong>bread:</strong>
<em>crust</em>
</span>
<span>
<strong>watermelon:</strong>
<em>rind</em>
</span>
...
</div>
The CSS is intended to keep word pairs together but allow text to break between <span>
elements. This behavior functions correctly in IE and FireFox.
In Webkit browsers (safari, chrome, opera), however, rather than moving a too-long span to the next line, the span gets clipped instead.
This seems to be a bug in webkit (and blink). Is there any workaround available for this issue?