Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Textarea preview

I have a problem regarding textarea and text previewing. It doesn't recognize Enter button as a newline character. Any ideas how to make this previewing correctly?

enter image description here

EDIT :

enter image description here

I want this text automatically change line when it's not fitting instead of h-scroll.

Answer :

pre {
 white-space: pre-wrap;       /* css-3 */
 white-space: -moz-pre-wrap;  /* Mozilla, since 1999 */
 white-space: -pre-wrap;      /* Opera 4-6 */
 white-space: -o-pre-wrap;    /* Opera 7 */
 word-wrap: break-word;       /* Internet Explorer 5.5+ */
}
like image 566
Fleeck Avatar asked Apr 21 '26 17:04

Fleeck


1 Answers

You can use <pre> tag while printing text from textarea it will reflect all your new lines as it is entered text in textarea

Just use <pre> before content.e.g.

<pre> Text Content From text Area</pre>
like image 105
Mohammad Sayeed Avatar answered Apr 23 '26 06:04

Mohammad Sayeed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!