Home >Web Front-end >Bootstrap Tutorial >How to reference fonts in bootstrap

How to reference fonts in bootstrap

(*-*)浩
(*-*)浩Original
2019-07-19 14:36:184082browse

In fact, there is no need to go to the following trouble. You only need to create a fonts folder and place it in the same directory as the js and css files, and it can be referenced correctly.

How to reference fonts in bootstrap

The key is that the following files must be present: (recommended learning: Bootstrap video tutorial )

glyphicons-halflings-regular.eot
glyphicons-halflings-regular.svg
glyphicons-halflings-regular.ttf
glyphicons-halflings-regular.woff

The relevant CSS rules are written on the bootstrap.css and bootstrap-min.css files in the css folder in the dist folder.

Please change the path of the font file flexibly

<style type="text/css">
        @font-face {
            font-family: 'Glyphicons Halflings';
            src: url('font/glyphicons-halflings-regular.eot');
            src: url('font/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), 
            url('font/glyphicons-halflings-regular.woff') format('woff'), 
            url('font/glyphicons-halflings-regular.ttf') format('truetype'), 
            url('fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
        }
</style>

So the font-face rule actually declares the font-family and location where the glyphicons are found.

For more technical articles related to Bootstrap, please visit the Bootstrap Tutorial column to learn!

The above is the detailed content of How to reference fonts in bootstrap. 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