Home >Web Front-end >CSS Tutorial >How to include Glyphicons in your Bootstrap 3 project using a CDN?

How to include Glyphicons in your Bootstrap 3 project using a CDN?

DDD
DDDOriginal
2024-11-03 20:57:29271browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn