So, I have a textarea that is filled with text from the DB for the user to edit. The text from the DB contains line breaks in it (\r\n). I would the textarea to only line wrap on line breaks. I've messed around with different white-space
attributes, but none seem to work. Right now, I have:
textarea
{
width: 60em;
height: 40em;
white-space: pre-line;
overflow: auto;
}
It does break on the line breaks, BUT ALSO breaks when the text on a line goes longer than 60em. How do I get it to only break on line breaks?
As andi pointed out, the answer is here: HTML Textarea horizontal scroll
<textarea wrap="off"></textarea>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With