让pre自动换行 - starspace - 博客园
强制不换行
div{
white-space:nowrap;
}
white-space:nowrap;
}
自动换行
div{
word-wrap: break-word;
word-break: normal;
}
word-wrap: break-word;
word-break: normal;
}
强制英文单词断行
div{
word-break:break-all;
}
word-break:break-all;
}
让pre自动换行:
pre{
white-space:pre-wrap; /* css-3 */
white-space:-moz-pre-wrap; /* Mozilla, since 1999 */
white-space:-pre-wrap; /* Opera 4-6 */
white-space:-o-pre-wrap; /* Opera 7 */
word-wrap:break-word; /* Internet Explorer 5.5+ */
}