Languages
[Edit]
EN

HTML - Textarea add horizontal scroll

14 points
Created by:
user4838
698

Using wrap="off"

We can solve it by using textarea tag attribute:

wrap="off"

Complete code example:

// ONLINE-RUNNER:browser;

<!doctype html>
<html lang="en">
<body>

<textarea wrap="off" style="width: 200px; height: 50px;">
Description random is static method that returns random float number from range
</textarea>

</body>
</html>

Expected result:

HTML - Textarea add horizontal scroll - solution using wrap="off"

Using white-space: nowrap; style

We can solve it by using style: 

white-space: nowrap;

Compete code example:

// ONLINE-RUNNER:browser;

<!doctype html>
<html lang="en">
<body>

<textarea style="white-space: nowrap; width: 200px; height: 50px;">
Description random is static method that returns random float number from range
</textarea>

</body>
</html>

Expected result:

HTML - Textarea add horizontal scroll - solution using white-space: nowrap; css styles

Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

HTML

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join