Languages
[Edit]
EN

HTML - Textarea add horizontal scroll

14 points
Created by:
Kate_C
19800

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

Native Advertising
50 000 ad impressions - 449$
🚀
Get your tech brand or product in front of software developers.
For more information contact us:
Red dot
Dirask - friendly IT community for everyone.

❤️💻 🙂

Join