问题
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