简体   繁体   中英

Problems with word-break css

I'm using jquery mobile with phonegap on android. I have css style

.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> .

There will be possibility that other CSS may Override your correct code.

You can Try this:

.itemClass {
   width:100%;  
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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