CSS: 引用字体文件,以及字体图标的使用_html/css_WEB-ITnose
Jun 21, 2016 am 08:48 AM
1. css文件(fonts.css)中引用字体文件:
@font-face {
font-family: 'bbBUS';
src: url('texticon.eot'); /*IE9*/
src: url('texticon.eot?#iefix') format('embedded-opentype'),
url('texticon.woff') format('woff'),
url('texticon.ttf') format('truetype');
}
tip:字体文件放在当前文件统计目录下,这样有更好的移植性(经测试,字体文件是要绝对路径引用,而css文件不用。亲测如此)
2. 字体图标的定义:
根据做字体图标时的对照图来定义:
1 |
|
3.字体图标的使用(HTML页面):
效果:

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Difficulty in updating caching of official account web pages: How to avoid the old cache affecting the user experience after version update?

How do I use HTML5 form validation attributes to validate user input?

How to efficiently add stroke effects to PNG images on web pages?

What is the purpose of the <meter> element?

What are the best practices for cross-browser compatibility in HTML5?

What is the purpose of the <datalist> element?

What is the purpose of the <iframe> tag? What are the security considerations when using it?

How do I use the HTML5 <time> element to represent dates and times semantically?
