Disable truncate listview header jquery mobile for long text (single word)

若如初见. 提交于 2020-01-06 08:39:22

问题


I have a jquery mobile listview . Currently the header of the list view truncates, and the text ends with a "...". I would like to disable this behavior and show the complete text. I ran into a few solutions but none of them work for a single word. i.e, text without white space, for example an email address does not work.


回答1:


DEMO

The CSS you are looking for is word-wrap:break-word;

ul li h2 {
    white-space: normal !important;
    word-wrap:break-word;
    overflow-wrap: break-word;
}

For more browser support you could try:

ul li h2{
    white-space: pre !important;           /* CSS 2.0 */
    white-space: pre-wrap !important;      /* CSS 2.1 */
    white-space: pre-line !important;      /* CSS 3.0 */
    white-space: -pre-wrap !important;     /* Opera 4-6 */
    white-space: -o-pre-wrap !important;   /* Opera 7 */
    white-space: -moz-pre-wrap !important; /* Mozilla */
    white-space: -hp-pre-wrap !important;  /* HP Printers */
    word-wrap: break-word;      /* IE 5+ */
}


来源:https://stackoverflow.com/questions/21682673/disable-truncate-listview-header-jquery-mobile-for-long-text-single-word

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!