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

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

I have two inline span. code sample:

    
6条回答
  •  遥遥无期
    2021-02-02 18:04

    I thing it will be helpful. You have to specify width, particular in your case.

    .comment_content{
      width:500px;
      border:1px solid #ccc;
    }
    
    .comment_author{
      width: 100px;
      float: left;
    }
    
    .comment_text{
      width: 400px;
      word-wrap: break-word;
      display:inline-block;
    }
    Hello qeqweqweqweqeeqeqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqweqeqweqweqweqweqweqweqwewqeqweqweqweqweqweqweqweqweqweqeqeqweqweqweqweqweqweqweqweqweqeqewqweqeq

    Here is a working examples to achieve what you want: examples

提交回复
热议问题