开发者

Line break in Label

开发者 https://www.devze.com 2023-01-01 17:33 出处:网络
when i m writing a long sentence in label without line break then it does wrap automatically. i m putting that 开发者_如何学Clabel intag. how can i wrap that long sentence.Unclear, but you can force a

when i m writing a long sentence in label without line break then it does wrap automatically. i m putting that 开发者_如何学Clabel in tag. how can i wrap that long sentence.


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>


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/


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消