Home >Web Front-end >CSS Tutorial >How to include Glyphicons in your Bootstrap 3 project using a CDN?
Bootstrap 3 Glyphicons CDN
With the addition of Glyphicons back into the Bootstrap 3 repository, accessing them through a CDN is now easier than ever before.
Using Bootstrap CDN with Glyphicons
The updated Bootstrap CSS file now includes Glyphicons and its dependencies. To include them in your project, you can simply reference Bootstrap's CDN:
In HTML:
<code class="html"><link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"></code>
In CSS:
<code class="css">@import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css");</code>
Remember to use ".glyphicon" classes instead of ".icon" for Glyphicon elements.
Using Glyphicons Separately
If you want to use Glyphicons without the rest of Bootstrap, you can directly reference the Glyphicons CSS file on Bootstrap CDN:
In HTML:
<code class="html"><link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet"></code>
In CSS:
<code class="css">@import url("//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css");</code>
Note that this approach only includes the Glyphicons CSS and does not load Bootstrap's JavaScript or other dependencies.
The above is the detailed content of How to include Glyphicons in your Bootstrap 3 project using a CDN?. For more information, please follow other related articles on the PHP Chinese website!