Suppose I have text inside a div right now. When I resize my browser to make it really small, the text goes on a 2nd line instead of making the scroll bar.
Instead, I would like to keep the text all on one line and just have a horizontal scroll bar. How can I do this? WIth overflow?
Use white-space:
#myDiv { white-space: nowrap; }
Or:
<div style="white-space: nowrap;">Long text that I do not want wrapped</div>
You can turn off automatic wrapping using the white-space property, like this:
#theDiv { white-space: nowrap }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With