[建議] Web 版 CSS 文字折行問題

看板PttCurrent作者 (虛物之海)時間9年前 (2015/04/22 15:07), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
現在的 web 版為了保存空白與 newline 而使用 white-space: pre; #main-content { position: relative; white-space: pre; } 但是這樣造成文字不會自動折行,遇到單行很長的文章讀起來很辛苦。 如果改成 white-space: pre-wrap; 則可以在保存空白與 newline 的情況下自動折行。 https://developer.mozilla.org/en-US/docs/Web/CSS/white-space pre-wrap 支援度只差 IE 6/7,如果要考慮 IE 6/7 也可以幫它們 fallback 成 pre。 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.167.82.112 ※ 文章網址: https://www.ptt.cc/bbs/PttCurrent/M.1429686422.A.230.html
文章代碼(AID): #1LDqYM8m (PttCurrent)