I have a div that I need to set the empty space to "no-wrap", but when I do this, all the children are set to no-wrap and this will ruin everything. How to apply a style to only one element, but not inherit it on other elements?
This is the way to do it:
#element {
white-space: nowrap;
}
#element * {
white-space: initial;
}
Or is there a better way? I would prefer it to be only one declaration of style.
<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 try to apply this to all descendants, not only to the first child nodes, but also to other similar messages, but not reply.
source
share