tags:

views:

38

answers:

2

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?

+1  A: 

Use white-space:

#myDiv { white-space: nowrap; }

Or:

<div style="white-space: nowrap;">Long text that I do not want wrapped</div>
Nick Craver
+1  A: 

You can turn off automatic wrapping using the white-space property, like this:

#theDiv { white-space: nowrap }
phisch