Retain newlines in HTML but wrap text: possible?

前端 未结 5 2065
再見小時候
再見小時候 2020-12-17 01:14

I came across an interesting problem today. I have a text email I\'m sending from a Web page. I\'m displaying a preview and wanted to put the preview in a fixed font retai

5条回答
  •  悲哀的现实
    2020-12-17 01:53

    Try

    selector {
      word-wrap: break-word; /* IE>=5.5 */
      white-space: pre; /* IE>=6 */
      white-space: -moz-pre-wrap; /* For Fx<=2 */
      white-space: pre-wrap; /* Fx>3, Opera>8, Safari>3*/
    }
    

提交回复
热议问题