我想让地球字体图标变大,以便它覆盖页面的大部分区域(它是矢量图像)。它不在按钮或其他任何东西中;它是单独的。有没有办法做到这一点?
<div class = "jumbotron">
<span class="glyphicon glyphicon-globe"></span>
</div>
我想让地球字体图标变大,以便它覆盖页面的大部分区域(它是矢量图像)。它不在按钮或其他任何东西中;它是单独的。有没有办法做到这一点?
<div class = "jumbotron">
<span class="glyphicon glyphicon-globe"></span>
</div>
将 glyphicon
的字体大小增加以增加所有图标的大小。
.glyphicon {
font-size: 50px;
}
只针对一个图标进行定位,
.glyphicon.glyphicon-globe {
font-size: 75px;
}
text-center
。 - Aibrean!important;
以覆盖boostrap CSS。 - MeanwhileInHellFontawesome有一个完美的解决方案。
我也实现了相同的功能。只需在您的主 .css 文件中添加以下内容:
.gi-2x{font-size: 2em;}
.gi-3x{font-size: 3em;}
.gi-4x{font-size: 4em;}
.gi-5x{font-size: 5em;}
在您的示例中,您只需要这样做。
<div class = "jumbotron">
<span class="glyphicon glyphicon-globe gi-5x"></span>
</div>
<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>
是的,基本上您也可以使用内联样式:
<span style="font-size: 15px" class="glyphicon glyphicon-cog"></span>
尝试使用标题,不需要额外的CSS
<h1 class="glyphicon glyphicon-plus"></h1>
例如...添加类:
btn-lg - 大号
btn-sm - 小号
btn-xs - 极小号
<button type=button class="btn btn-default btn-lg">
<span class="glyphicon glyphicon-star" aria-hidden=true></span> Star
</button>
<button type=button class="btn btn-default">
<span class="glyphicon glyphicon-star" aria-hidden=true></span>Star
</button>
<button type=button class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-star" aria-hidden=true></span> Star
</button>
<button type=button class="btn btn-default btn-xs">
<span class="glyphicon glyphicon-star" aria-hidden=true></span> Star
</button>
Bootstrap 参考链接: Bootstrap 图标字体