开发者

How to wrap a word in div?

开发者 https://www.devze.com 2023-04-10 18:57 出处:网络
I am building in jQuery mobile framework. I have the following structure that I want to display in a kind of table layout:

I am building in jQuery mobile framework.

I have the following structure that I want to display in a kind of table layout:

<div style="word-wrap:break-word" class="ui-block-n" ><li>verylongword.........</li></div>

My problem is that when I have long words, the words go outside of the div (i.e. overflow). I would li开发者_Python百科ke the words to be wrapped. I used word-wrap:break-word, but this doesn't seem to work. I also tried all of these options, with no success:

 white-space: pre-wrap;      
 white-space: -moz-pre-wrap; 
 white-space: -pre-wrap;     
 white-space: -o-pre-wrap;   
 word-wrap: break-word;  

How can I get my words to wrap?


You need the whole word-wrap thing on your li's:

<style>
li {
word-wrap:break-word;
}
</style>
0

精彩评论

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

关注公众号