简体   繁体   English

word-break css的问题

[英]Problems with word-break css

I'm using jquery mobile with phonegap on android. 我在android上使用带有phonegap的jquery mobile。 I have css style 我有css风格

.itemClass p{
    width:100%;
    min-height:50px;
    text-transform:capitalize;
    word-break:break-all !important;
    word-wrap:break-word !important;
}

I'm creating ul dynamivcally like this 我正在创造像这样的动态

...
var out = '<ul data-role="listview">';
$(data["data"]).each(function(index, element){
    out += '<li class="itemClass"><p>' + element.text + '</p></li>';
});
out += "</ul>";
...

Styles word-break and word-wrap not applying to items. 样式分词和自动换行不适用于项目。

Your Code is correct. 您的准则是正确的。

It is working fine, see this Fiddle But still we can try to add "width" to it's parent <li> . 它工作正常,看到这个小提琴但我们仍然可以尝试将“宽度”添加到它的父<li>

There will be possibility that other CSS may Override your correct code. 其他CSS可能会覆盖您的正确代码。

You can Try this: 你可以尝试这个:

.itemClass {
   width:100%;  
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM