Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change color of bootstrap glyphicon?

I want to change bootstrap glyphicon color to "yellow" because current color is showing in white that looks like Delete button. How can i change color of glyphicon-folder-close or use any other glyphicon that display folder image better ?

main.html

<button type="button" class="btn btn-info btn-lg" ng-click="serverFiles()" style="margin-left: 10px"><span class="glyphicon glyphicon-folder-close"></span></button>
like image 230
hussain Avatar asked Aug 16 '16 15:08

hussain


People also ask

How do I change the color of a Glyphicon in bootstrap?

Approach: First, we need to assign the id attribute to the particular glyphicon which you need to customize by using CSS. We can apply the color property to the particular id and change the icon color by using a hex value or normal color. The id is an attribute that is used to access the whole tag.

How do I style bootstrap icons?

How to Resize Bootstrap Icons in CSS and HTML? To resize web fonts, use the CSS 'font-size' attribute. font-size can be added in style tag in html or apply css selector to add the styles. Change width=“32” and height=“32” to SVG tag in html.

Is bootstrap a Glyphicon?

Bootstrap provides set of graphic icons, symbols and fonts called Glyphicons. Some Glyphicons like Home icon, User icon, Lock icon, etc. Generally, Glyphicons are icon fonts which you can use in your web projects. Bootstrap includes 260 glyphicons.

How do I change Glyphicon size?

If you need to change the size of glyphicons, use the CSS font-size property.


2 Answers

You can also change the icon/text by adding to the class "text-success" for green, "text-danger" for red etc. This will change the color of the icon itself.

<span class="glyphicon glyphicon-usd text-success"></span>

Also this has been answered here.

Change the color of glyphicons to blue in some- but not at all places using Bootstrap 2

like image 172
Andrew Avatar answered Sep 28 '22 01:09

Andrew


Use color

 <button type="button" 
      class="btn btn-info btn-lg" ng-click="serverFiles()"
      style="margin-left: 10px; color:#FF0000;">
          <span class="glyphicon glyphicon-folder-close"></span></button>

But remember that it is desirable to avoid the use of inline style is better use classes or references based on external css configuration items

 <button type="button" 
      class="btn btn-info btn-lg mybtn-blue" ng-click="serverFiles()"
      style="margin-left: 10px;">
          <span class="glyphicon glyphicon-folder-close"></span></button>

edn for external css

.mybtn-blue {
   color: blue;
}
like image 23
ScaisEdge Avatar answered Sep 28 '22 03:09

ScaisEdge