tags:

views:

67

answers:

3

when i m writing a long sentence in label without line break then it does wrap automatically. i m putting that label in tag. how can i wrap that long sentence.

+1  A: 

Unclear, but you can force a line break by adding a <br /> in it.

<label>Some long long long long long long<br /> long long long label</label>
Dustin Laine
+1  A: 

create style sheet like this "

.label { word-wrap: break-word }

and assign to you label

check the link for more detail : http://www.css3.com/css-word-break/

Pranay Rana
What is break- word?Explain it.
picnic4u
check the link posted in ans for more detail
Pranay Rana
Not familiar with ASP.NET, but since it uses the main framework still, can't you use the word-wrap property of the control? Or, set the control to be a multi-line label (Might be thinking of TextBox here...). Either way, WordWrap property should work too?
Zack
A: 

I'd hesitate to use the CSS3 solution without some kind of IE fallback.

You need to add the following CSS to your label:

label { display: block; width: 100px; }

Then change the width to the width you'd like your label to be and the sentence will wrap within the space.

By default a label has inline display which makes width control difficult.

If you still need the label to be inline with your input field, float the label.

sitesbyjoe