Fontawesome图标可防止换行 [英] Fontawesome icon prevent newline wrapping

查看:148
本文介绍了Fontawesome图标可防止换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何防止在字体图标和该图标附近的文本之间插入换行符?

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

请参见小提琴,我有一个nbsp,但已将其丢弃.

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

在下面的示例中,我不希望在图标和单词"first"之间发生换行,但是可以在"first"和"second"之间发生换行.不过,它不起作用,请看小提琴.

In the example below, I don't want a wrap to ever occur between the icon and the word "first", but it can occur between "first" and "second". It doesn't work though, see the fiddle.

  <i class="fa fa-search"></i>&nbsp;first second

它与这个问题有关,但我似乎无法使其起作用:

It is related to this question, but I can't seem to make it work:

附加字体图标在文本字符串中最后一个单词并防止换行

推荐答案

添加CSS:.fa { display:inline; }

演示小提琴.

这篇关于Fontawesome图标可防止换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆