I'm using Glyphicons in Bootstrap. I was calling in the CSS straight from http://glyphicons.getbootstrap.com/css/bootstrap-glyphicons.css but this has now disappeared and was not recommended.
This apparently coincides with Twitter making the Glyphicons available in the Bootstrap package again. I am using Bootstrap 3.0.0 RC1 or RC2.
My problem: I have no idea how to use the icons in my own hosting... Seems to me the code is contained within the bootstrap.css (?). I have uploaded the "fonts" directory but am only getting blank, empty-box icons where there should be proper icons.
Any ideas please? What should be where and how should it be called?
Bootstrap 3 Glyphicons are actually fonts, so you can scale them and color them as you please. Bootstrap previously used image sprites for icons. To add a glyphicon, add a <span> tag with Bootstrap's . glyphicon class and also the class for the specific glyphicon that you require.
Bootstrap 4 does not have its own icon library (Glyphicons from Bootstrap 3 are not supported in BS4). However, there are many free icon libraries to choose from, such as Font Awesome and Google Material Design Icons.
In lines 15 and 17 the <span> and <a> element has the bootstrap glyphicon glyphicon-pencil classes, so to use any glyphicon in bootstrap: Use the <span> or <a> element. Set the class attribute of the <span> or <a> element as glyphicon then a space and then glyphicon-iconname.
The bootstrap-glyphicons.css
file seems to have been removed with the final\production Bootstrap 3.0.0. Simply download the zip from http://getbootstrap.com/ and then copy the dist/css/bootstrap.min.css
file in your css folder. You should then include it in your HTML page as such:
<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 101 Glyphicons</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap CSS file -->
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
<!-- Glyphicon in a H1 tag -->
<h1>Hello, <span class="glyphicon glyphicon-globe"></span> !</h1>
</body>
</html>
Source: http://getbootstrap.com/getting-started/
If you have already put in the fonts directory, calling the icons now would be <span class="glyphicon glyphicon-pencil"></span>
instead of <i class="icon-large icon-pencil"></i>
.
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