How Do I Make Glyphicons Bigger? (Change Size?)

2019-03-07 14:15发布

I would like to make the globe glyphicon bigger so that it covers up a large portion of the page (it's a vector image). It's not in a button or anything; it's just alone. Is there a way to do this?

<div class = "jumbotron">
    <span class="glyphicon glyphicon-globe"></span>
</div>  

7条回答
手持菜刀,她持情操
2楼-- · 2019-03-07 14:41

Fontawesome has a perfect solution to this.

I implemented the same. just on your main .css file add this

.gi-2x{font-size: 2em;}
.gi-3x{font-size: 3em;}
.gi-4x{font-size: 4em;}
.gi-5x{font-size: 5em;}

In your example you just have to do this.

<div class = "jumbotron">
    <span class="glyphicon glyphicon-globe gi-5x"></span>
</div>  
查看更多
戒情不戒烟
3楼-- · 2019-03-07 14:44

try to use heading, no need extra css

<h1 class="glyphicon glyphicon-plus"></h1>
查看更多
闹够了就滚
4楼-- · 2019-03-07 14:47

If you are using bootstrap and font-awesome then it is easy, no need to write a single line of new code, just add fa-Nx, as big you want, See the demo

<span class="glyphicon glyphicon-globe"></span>
<span class="glyphicon glyphicon-globe fa-lg"></span>
<span class="glyphicon glyphicon-globe fa-2x"></span>
<span class="glyphicon glyphicon-globe fa-3x"></span>
<span class="glyphicon glyphicon-globe fa-4x"></span>
<span class="glyphicon glyphicon-globe fa-5x"></span>
查看更多
ゆ 、 Hurt°
5楼-- · 2019-03-07 14:50

Yes, and basically you can also use inline style:

<span style="font-size: 15px" class="glyphicon glyphicon-cog"></span>
查看更多
趁早两清
6楼-- · 2019-03-07 14:52

I've used bootstrap header classes ("h1", "h2", etc.) for this. This way you get all the style benefits without using the actual tags. Here is an example:

<div class="h3"><span class="glyphicon glyphicon-tags" aria-hidden="true"></span></div>

查看更多
三岁会撩人
7楼-- · 2019-03-07 14:53

Increase the font-size of glyphicon to increase all icons size.

.glyphicon {
    font-size: 50px;
}

To target only one icon,

.glyphicon.glyphicon-globe {
    font-size: 75px;
}
查看更多
登录 后发表回答