I have a div that I need to set the white-space to "no-wrap" but when I do that all the child elements are set to no-wrap and it messes things up. How do I apply a style only to one element but not have other elements inherit it?
Is this the way to do it:
#element {
white-space: nowrap;
}
#element * {
white-space: initial;
}
Or is there a better way? I would rather it only be one style declaration.
<div id="element">
<div id="other1"><div>
<div id="other2"><div>
<div id="other3"><div>
<div id="other..."><div>
<div id="other100"><div>
</div>
I am trying to apply this to all descendants not merely the first child nodes as other similar posts mentioned but do not answer.