How Do I Make Glyphicons Bigger? (Change Size?)
Scaling up your glyphicons is as simple as upping the font-size
in your CSS. Here, we're doubling the size:
Just tag your icon with .glyphicon
class to see magic happen.
Using different units of measurement
Let's get a bit more specific. You can use different units in CSS, because, well... size matters. You can resize glyphicons using px
, em
, rem
, pt
, vw
, vh
. And dare I say... %
?
Sass it up with CSS classes
Make your own scalable CSS classes, such as gi-5x
. It's like building your very own Fontawesome from scratch, but with less code writing:
Just tag class="gi-5x"
to your span
and enjoy the 5 times larger icon!
Lock and load glyphicons in Bootstrap
Want to rescale icons inside your headers or jumbotron? Bootstrap has your back:
This nifty technique ensures the glyphicon inherits the wrapping element's size. You can sit back and enjoy the show.☕
Gotcha! Handle glyphicons with care
Avoid the pitfall if glyphicon is hiding within parent elements such as buttons or input groups. They might override your size alterations:
Ensure parent styles don't impede your scaling strategy.
Faster, Better, Stronger with Font Awesome
Thinking of switching to Font Awesome? They've got an arsenal of built-in size classes, just waiting to get picked. Meet fa-lg
, fa-2x
, fa-3x
, and so on.
Quick auf wiedersehen with inline CSS
Need a quick fix? Show `em what you've got with inline styles:
While certainly not a permanent solution, it is a great road-side assistance!
Was this article helpful?