Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text not wrapping in label tag

Tags:

html

css

How do you wrap text in a tag?

I have set the width however text just continues to overflow the element.

Thanks

like image 926
timewarpagain Avatar asked Nov 10 '09 19:11

timewarpagain


People also ask

How do you wrap text in a tag?

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”.

How do I force wrap text in HTML?

You can force long (unbroken) text to wrap in a new line by specifying break-word with the word-wrap property.

How do you wrap text in a label in Visual Studio?

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.


2 Answers

Give this a try

 <div style="white-space:wrap">Some long text........</div>
like image 93
Bob Avatar answered Oct 04 '22 12:10

Bob


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.

like image 40
matthewsheets Avatar answered Oct 04 '22 13:10

matthewsheets