开发者

text wrapping for one long word

How do i make a 开发者_高级运维text wrap inside a div so that even one long word will be wrapped not only nicely spaced words? do i need js to do this?


<div style=”word-wrap: break-word”>Here is some content for the div element</div> 

found similar question: How to word wrap text in HTML?

References:

http://www.css3.com/css-word-wrap/

http://www.1keydata.com/css-tutorial/wrap.php

http://bytes.com/topic/html-css/answers/627827-how-wrap-text-css


you can use word-wrap: break-word; in your css for the div.


using css you can achieve

word-wrap:break-word

Style

div {
    word-wrap: break-word;
}

HTML

<div>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</div>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜