Fontawesome icon prevent newline wrapping

前端 未结 4 1091
借酒劲吻你
借酒劲吻你 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:30

    I had this issue and the cause was that the font awesome icon was automatically being inserted within it's own new p element. I'm not sure why this was happening, but I solved it with this CSS:

    p { display: inline;}

    Make sure you specify which p element you're targeting, so that you don't change every p element on your page!

提交回复
热议问题