css word-wrap: break-word won't work

前端 未结 6 1547
鱼传尺愫
鱼传尺愫 2021-02-02 17:11

I have two inline span. code sample:

    
6条回答
  •  情歌与酒
    2021-02-02 18:01

    Use the word-break style to define where in the word to break to the next line. By default, it uses spaces or hyphens but you can set it to break-all to allow breaking on any letter:

    .comment_text {
        display: inline-block;
        word-wrap: break-word;
        word-break: break-all;
        width: 100%;
    }
    

提交回复
热议问题