Stop word-wrap dividing words

前端 未结 12 1323
南方客
南方客 2020-12-16 11:00
body { word-wrap: break-word;}

I\'ve been using that code (above) to fit the text in the body into it\'s container. However what I don

12条回答
  •  没有蜡笔的小新
    2020-12-16 11:35

    In my situation I am trying to ensure words wrap at proper word-breaks within table cells.

    I found I need the following CSS to achieve this.

    table {
      table-layout:fixed;
    }
    td {
      white-space: wrap;
    }
    

    also check that nothing else is changing word-break to break-word instead of normal.

提交回复
热议问题