当前位置: 移动技术网 > IT编程>网页制作>CSS > CSS3 @font-face属性使用指南

CSS3 @font-face属性使用指南

2019年07月25日  | 移动技术网IT编程  | 我要评论

芦溪县人民政府,打扮,识骨寻踪第八季

html


复制代码
代码如下:

<body>
<!-- ul.layout>li*5>a[href=#]>i.icon -->
<!-- sublime text 快捷拼写 -->
<ul class="layout">
<li><a href="#"><i class="icon">&#xe601;</i></a></li>
<li><a href="#"><i class="icon">&#xe600;</i></a></li>
<li><a href="#"><i class="icon">&#xe602;</i></a></li>
<li><a href="#"><i class="icon">&#xe603;</i></a></li>
<li class="last-child"><a href="#"><i class="icon">&#xe604;</i></a></li>
<div class="clear"></div>
</ul>
</body>

css


复制代码
代码如下:

<style>
* {margin:0; padding:0;}
body { background-color: #fc0; padding-top: 50px;}
ul li { list-style: none;}
a { text-decoration: none;}
.clear { clear:both;}
.layout { width:604px; margin:0 auto;}
.layout li { display: block; float: left; border-right: 1px solid #930808; }
.layout li.last-child { border-right: none;}
.layout li a { display: block; width: 120px; height:120px; line-height: 120px; text-align: center; background-color: #f00;}
.layout li a i { color:#fc0;}
.layout li a:hover i { color:#fff;}
@font-face {
font-family: "icomoon";
src:url('fonts/icomoon.eot?-9731bi');
/*↑兼容ie9兼容模式打开ie8及其以下浏览器可以显示;*/
/*↓兼容ie9可以显示;*/
src:url("fonts/icomoon.eot?#iefix") format("embedded-opentype"),
url("fonts/icomoon.woff") format("woff"),
url("fonts/icomoon.ttf") format("truetype"),
url("fonts/icomoon.svg") format("svg");
/*eot { 微软开发用于嵌入网页中的字体,ie专用字体; }
**woff { web字体中最佳格式,被w3c推荐; }
**ttf { 由microsoft和apple联合开发的一套字体标准,是mac os和win操作系统中最常见的的一种字体; }
**svg { 用于svg字体渲染的一种格式,是由w3c制定的开放标准的图形格式; }
*/
font-weight: normal;
font-style: normal;
}
.icon {
font-family: "icomoon";
font-style: normal;
font-weight: normal;
font-size: 90px;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
/*抗锯齿属性*/
}
</style>

效果图:

字体图标下载网站:icomoon

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网