Languages
[Edit]
EN

HTML - Textarea add horizontal scroll

14 points
Created by:
Kate_C
2857

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

Hey 👋
Would you like to know what we do?
  • Dirask is a friendly IT community for learners, professionals and hobbyists to share their knowledge and help each other in extraordinary easy way.
  • We welcome everyone,
    no matter what the experience,
    no matter how basic the question is,
    this community will help you.