How do you wrap text in a tag?
I have set the width however text just continues to overflow the element.
Thanks
First, we create an HTML document that contains a <pre> tag. Now, use the CSS overflow-x property set to “auto” which adds the scrollbar automatically when the contents are overflow. Set the white-space property to “pre-wrap”.
You can force long (unbroken) text to wrap in a new line by specifying break-word with the word-wrap property.
Just set Label AutoSize property to False. Then the text will be wrapped and you can re-size the control manually to show the text. Save this answer.
Give this a try
<div style="white-space:wrap">Some long text........</div>
To anyone still struggling, be sure to check and see if you've set a line-height value on the font in question: it could be overriding the word wrap, even if you've done it correctly.
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