2008-08-29

用CSS的white-space及word-wrap讓pre中自動換行

pre {

width:600px;
overflow-x:visible !important;
overflow-x:hidden; /* Internet Explorer 6 */


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+ */

}

沒有留言: