Stop word-wrap dividing words

前端 未结 12 1288
南方客
南方客 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:17

    This helped me with old Webkit - this one from phantomjs 2.1

    .table td {
        overflow-wrap: break-spaces;
        word-break: normal;
    }
    
    0 讨论(0)
  • 2020-12-16 11:20

    Use white-space: nowrap;

    CSS white-space Property

    white-space: normal|nowrap|pre|pre-line|pre-wrap|initial|inherit;

    Know more about white-space example

    0 讨论(0)
  • 2020-12-16 11:23

    May be a bit late but you can add this css to stop word breaks:

    .element {
        -webkit-hyphens: none;
        -moz-hyphens:    none;
        -ms-hyphens:     none;
        hyphens:         none;
    }
    
    0 讨论(0)
  • 2020-12-16 11:29

    use white-space: wrap;. If you have set width on the element on which you are setting this it should work.

    update - rendered data in Firefox alt text

    0 讨论(0)
  • 2020-12-16 11:29

    I use this Code for our website to stop the word-breaking:

    body {
        -ms-hyphens: none;
        -webkit-hyphens: none;
        hyphens: none;
    }
    
    0 讨论(0)
  • 2020-12-16 11:33

    Please use nowrap and wrap value didn't come for me. nowrap solved the issue.

    Use white-space: nowrap;
    
    0 讨论(0)
提交回复
热议问题