Fontawesome icon prevent newline wrapping

前端 未结 4 1074
借酒劲吻你
借酒劲吻你 2021-01-01 10:36

how can I prevent a newline to be inserted between a fontawesome icon and the text that is near this icon ?

See the fiddle, I have a nbsp, but it is discarded.

4条回答
  •  伪装坚强ぢ
    2021-01-01 11:19

    This seems to work, click Run code snippet below:

    body {
      text-align: center;
    }
    
    .resizable-wrapper {
      border: solid 1px black;
      resize: both;
      overflow: auto;
    }
    
    .item {
      position: relative;
      padding-left: 20px;
    }
    
    .item + .item {
      margin-left: 20px;
    }
    
    .fa {
      position: absolute;
      top: 0;
      left: 0;
    }
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin rutrum libero eget justo tempor ornare. Sed aliquam libero sed quam facilisis fringilla. Pellentesque habitant

提交回复
热议问题