The bootstrap looks for the color according to the css already applied on the page. For example, if you have an icon inside a link, and you have changed the color of the links in css, the icon will be the same color, for example:
<!DOCTYPE html>
<html lang="pt">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script><scriptsrc="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Glyphicon Examples</h2>
<p>Envelope icon: <span class="glyphicon glyphicon-envelope"></span></p>
<p>Envelope icon as a link:
<a href="#"><span class="glyphicon glyphicon-envelope"></span></a>
</p>
<p>Search icon: <span class="glyphicon glyphicon-search"></span></p>
<p>Search icon on a button:
<button type="button" class="btn btn-default">
<span class="glyphicon glyphicon-search"></span> Search
</button>
</p>
<p>Search icon on a styled button:
<button type="button" class="btn btn-info">
<span class="glyphicon glyphicon-search"></span> Search
</button>
</p>
<p>Print icon: <span class="glyphicon glyphicon-print"></span></p>
<p>Print icon on a styled link button:
<a href="#" class="btn btn-success btn-lg">
<span class="glyphicon glyphicon-print"></span> Print
</a>
</p>
</div>
</body>
</html>
Home
Source:
w3schools.
From the bootstrap 3.0 version you can change the forr of an icon just by changing the attribute color
of CSS. Example:
.pink{
color: pink;
}
<!DOCTYPE html>
<html lang="pt">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script><scriptsrc="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Glyphicon Examplos</h2>
<p>CSS Inline: <span class="glyphicon glyphicon-envelope" style="color:red;"></span></p>
<p>Adicionando classe:
<a href="#"><span class="glyphicon glyphicon-envelope pink"></span></a>
</p>
</div>
</body>
</html>
Remembering that you can change the size of the icon with the font-size
attribute, as in the example below:
.fonte-maior{
font-size: 40px;
}
<!DOCTYPE html>
<html lang="pt">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script><scriptsrc="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h2>Glyphicon Examplos</h2>
<p>Sem fonte:
<a href="#"><span class="glyphicon glyphicon-envelope"></span></a>
</p>
<p>Com fonte:
<a href="#"><span class="glyphicon glyphicon-envelope fonte-maior"></span></a>
</p>
</div>
</body>
</html>