I'm using Twitter Bootstrap and it says to use <i class="icon-flag"></i>
if I want to use an icon from their CSS sprite.
How can I add my own css class called .logo-icon
which will take one of their icons but make it bigger?
My class currently looks like:
.logo-icon {
background-image: url("../img/glyphicons-halflings-white.png");
background-position: -312px -24px;
}
Larger icons To increase icon sizes relative to their container, use the fa-lg (33% increase), fa-2x , fa-3x , fa-4x , or fa-5x classes. If your icons are getting chopped off on top and bottom, make sure you have sufficient line-height.
Larger Icons To increase the size of icons relative to its container, use icon-large , icon-2x , icon-3x , or icon-4x . Increase the icon size by using the icon-large (33% increase), icon-2x , icon-3x , or icon-4x classes.
Bootstrap Icon type bold Icon | type bold | HTML, CSS It is pretty simple to change color of icon Type bold just add style="color:red" it will make font color red. On the same way you can change size of Type bold icon by just adding style="font-size:50px;".
is to change font size of the span
tag
span.glyphicon {
font-size: 8px;
}
or
<span class="glyphicon glyphicon-check" style="font-size: 1.2em"></span>
And if like me you use FontAwesome too, you could go hybrid ;) use these classes
<span class="glyphicon glyphicon-check fa-lg"></span>
<span class="glyphicon glyphicon-check fa-2x"></span>
<span class="glyphicon glyphicon-check fa-3x"></span>
<span class="glyphicon glyphicon-check fa-4x"></span>
What if you use scale()???
.logo-icon {
transform:scale(2.0,2.0);
-ms-transform:scale(2.0,2.0); /* IE 9 */
-moz-transform:scale(2.0,2.0); /* Firefox */
-webkit-transform:scale(2.0,2.0); /* Safari and Chrome */
-o-transform:scale(2.0,2.0); /* Opera */
}
Isn't it easier to use and maintain? You can scale to any size you wish without recalculating background-size and position.
I am using this for reducing the size of the icons in some parts of my system. I spent around 1 hour looking for a solution to reduce and almost forgot about scale(). So, just sharing to help others. =D
But, of course, if you make them bigger you will not get a perfect good looking icon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With