How can I set the white-space property to "no-wrap" for a specific div without affecting its child elements? Is there a way to achieve this with just one style declaration?
I've come across this solution, but I'm looking for a more concise method:
#element {
white-space: nowrap;
}
#element * {
white-space: initial;
}
Or is there a better approach that achieves the same result with only one line of code?
<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 want to apply this style to all descendants, not just the immediate child nodes as suggested in other resources. Can anyone provide a more direct solution?