twitter-bootstrap 增加字体真棒图标

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18688630/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 18:18:26  来源:igfitidea点击:

increase font awesome icons

htmlcsstwitter-bootstrapfont-awesome

提问by zazvorniki

I'm having a bit trouble with some font-awesome icons. I'm trying to increase the size of a few of them, but for some reason nothing I seem to do works.

我在使用一些字体很棒的图标时遇到了一些麻烦。我正在尝试增加其中一些的大小,但由于某种原因,我似乎没有做任何工作。

Here is my html

这是我的 html

<div class="span5 bookBuild">
 <div class="well well-small">
   <h4>Build your Book!</h4>
   <div class="span2">
      <i class="icon-file icon-large"></i>
   </div><!--span2-->
   <div class="span9">
      <p>This is a paragraph</p>
    </div><!--span9-->
    <p class="clearfix"></p>
   </div><!--well-->
 </div><!--span5-->

and I have tried to add as you can see the icon-largeclass as well as the icon-2xclass. None of the icon-2x- icon-4xare working.

我试图添加,因为您可以看到icon-large课程和icon-2x课程。没有一个icon-2x-icon-4x正在工作。

I have also tried targeting the specific icon and then increasing the font size such as font-size: 3em;

我也尝试过针对特定图标,然后增加字体大小,例如 font-size: 3em;

Any help would be amazing!

任何帮助都会很棒!

回答by Shariq

we can make some icon bigger using font awesome. Font awesome provided a class to increse them.

我们可以使用很棒的字体使一些图标更大。Font Awesome 提供了一个类来增加它们。

To increase icon sizes relative to their container, use the fa-lg (33% increase), fa-2x, fa-3x, fa-4x, or fa-5x classes.

要增加相对于其容器的图标大小,请使用 fa-lg(增加 33%)、fa-2x、fa-3x、fa-4x 或 fa-5x 类。

http://fortawesome.github.io/Font-Awesome/examples/

http://fortawesome.github.io/Font-Awesome/examples/

回答by Mike2145

This worked for me in bootstrap ONLY after I added !important, like this:

这仅在我添加后才在引导程序中对我有用!important,如下所示:

.fa-big{font-size: 100px !important;}

回答by David Lemayian

Use icon-4xinstead of icon-large. See here: http://bootply.com/79841

使用icon-4x代替icon-large。见这里:http: //bootply.com/79841

回答by cmac

Font Awesome is a font so add a class and increase the font-size

Font Awesome 是一种字体,所以添加一个类并增加字体大小

 .fa-big{
    font-size: 100px;
 }


<i class="fa fa-ship fa-big"></i>