user2075328 user2075328 - 8 days ago 5
CSS Question

how to scroll text area horizontally?

How to scroll text area horizontally? I googled for it but could not find a good solution.

I tried the following css, but it is not working.

overflow-x: scroll;

<textarea></textarea>

Answer

Add the below lines to your CSS:

white-space: nowrap; /* will prevent the default wrapping of text to next line */
overflow-x: auto; /* will make horizontal scroll-bar appear only when needed */

Demo Fiddle