Languages
[Edit]
EN

HTML - Textarea add horizontal scroll

14 points
Created by:
Kate_C
22870

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

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