font-face自定义字体,iconfont就是把各种图片做成字体。iconfont优势:
字体文件小,一般20-50kb;
容易编辑和维护,尺寸和颜色可以用css来控制;
透明完全兼容IE6;
 
 
 
webkit下可以做渐变:
margin: 0 0 0 50px; 
    font-size: 50px; 
    font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', 'Helvetica, Arial', 'Lucida Grande', 'sans-serif'; 
    background: -webkit-repeating-linear-gradient(top, red 0px, blue 60px);
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
 
不支持的话,可以用伪类after before来模拟
 
使用:

@font-face {
     font-family: 'icon-fonts';
     src:url('../fonts/icon-fonts.eot');  /* IE9*/ 
     src:url('../fonts/icon-fonts.eot?#iefix') format('embedded-opentype'),       /* IE6-IE8 */
          url('../fonts/icon-fonts.woff') format('woff'),    /* chrome、firefox */
          url('../fonts/icon-fonts.ttf') format('truetype'),   /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
          url('../fonts/icon-fonts.svg#icon-fonts') format('svg');   /*  iOS 4.1- */
     font-weight: normal;
     font-style: normal;
}

[class^="icon-"], [class*=" icon-"] {
     font-family: 'icon-fonts';
     speak: none;
     font-style: normal;
     font-weight: normal;
     font-variant: normal;
     text-transform: none;
     line-height: 1;
     -webkit-font-smoothing: antialiased;/* Better Font Rendering */
}
.icon-zan:before {
     content: "\e600";
}
.icon-ask:before {
     content: "\e601";
}
.icon-start:before {
     content: "\e602";
}
.icon-down:before {
     content: "\e606";
}
.icon-love:before {
     content: "\e60c";
}
.icon-mi:before {
     content: "\e604";
}
.icon-look:before {
     content: "\e605";
}
.icon-comment:before {
     content: "\e60a";
}
.icon-answer:before {
     content: "\e603";
}
.icon-comment1:before {
     content: "\e60b";
}
.icon-female:before {
     content: "\e608";
}
.icon-male:before {
     content: "\e609";
}
.icon-close:before {
     content: "\e60d";
}
.icon-broadcast:before {
     content: "\e607";
}

 
CSS3文字渐变:
<style>
h1 {
font-size: 60px;
text-align: center;
margin: 40px;
color: #000;
}
h1.methodA {
background: -webkit-linear-gradient(top, #1965a9, #000);
background: linear-gradient(top, #1965a9, #000);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
h1.methodB {
-webkit-mask-image: -webkit-linear-gradient(top, rgba(0,0,0,1), rgba(0,0,0,.3) 50%, rgba(0,0,0,1));
-webkit-mask-image: linear-gradient(top, rgba(0,0,0,1), rgba(0,0,0,.3) 50%, rgba(0,0,0,1));
}
</style>
<h1 class="methodA">Awesome Gradient Text Method A</h1>
<h1 class="methodB">Awesome Gradient Text Method B</h1>

Icon font font face的更多相关文章

  1. 如何将 Font Awesome 转成 PNG 图标 详细教程 含源代码

    最近因为项目上需要用到这个字体图标,但是它里面的许多也不能完全满足项目需要,因此就考虑将这个图标导出,然后自己再添加一些其他图标使用 搜索了些解决方案,如:http://www.oschina.net ...

  2. 【转载】CSS font关键字属性值的简单研究

    文章转载自 张鑫旭-鑫空间-鑫生活 http://www.zhangxinxu.com/wordpress/ 原文链接:http://www.zhangxinxu.com/wordpress/?p=5 ...

  3. How to set font and colors of Eclipse UI

    The original URL of this article is https://codeyarns.com/2014/11/03/how-to-set-font-and-font-size-o ...

  4. Java基础之扩展GUI——使用字体对话框(Sketcher 5 displaying a font dialog)

    控制台程序. 为了可以选择系统支持的字体,我们定义了一个FontDialog类: // Class to define a dialog to choose a font import java.aw ...

  5. iOS FONT字体名

    下面这段代码可以查看ios中可用的字体,具体那些字体长什么样,可以查看字体册工具. NSArray *familyArray = [UIFont familyNames]; for (id famil ...

  6. css基础之 font的简写规则 以及 自定义 CSS3 @font-face详细用法

    Part 1 font简写 CSS的命名规则是用英文字母 数字 和下划线(一般用小写)来命名.简写css font的好处有三:一是写起来方便(就像键盘快捷键):二是简化代码:三是帮助你熟悉和深刻理解c ...

  7. css font简写规则

    是不是在很很多网站的公共样式中会看到这样的代码?font: 12px/150% Arial, Verdana, "\5b8b\4f53";意思为:字体大小/行高 字体族 " ...

  8. 【CSS】font样式简写(转)- 不是很建议简写

    一.字体属性主要包括下面几个 font-family,font-style,font-variant,font-weight,font-size,font font-family(字体族): “Ari ...

  9. java====color、font、button、label、textfield、textarea使用

    1. Color类 µ 公共静态属性:共13个静态属性,分别代表13种不同的颜色常量. µ 构造函数 ü public Color(int r,int g,int b):以整数形式给出红.绿.蓝三个分 ...

随机推荐

  1. js中的||与&&用法

    &&和||在JQuery源代码内尤为使用广泛,由网上找了些例子作为参考,对其用法研究了一下: &&: function a(){ alert("a" ...

  2. caffe源码 卷积层

    通俗易懂理解卷积 图示理解神经网络的卷积 input: 3 * 5 * 5 (c * h * w) pading: 1 步长: 2 卷积核: 2 * 3 * 3 * 3 ( n * c * k * k ...

  3. Python s12 Day3 笔记及作业

    1. Set集合 old_dict = { "#1":{ 'hostname':'c1', 'cpu_count':2, 'mem_capicity':16}, "#2& ...

  4. 从头编写 asp.net core 2.0 web api 基础框架 (1)

    工具: 1.Visual Studio 2017 V15.3.5+ 2.Postman (Chrome的App) 3.Chrome (最好是) 关于.net core或者.net core 2.0的相 ...

  5. MongoDB数据库的安装、配置和使用

    1.下载安装包   wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.7.tgz 2.解压安装包   tar -zxf mo ...

  6. Windows下Apache添加SSL模块

    参考资料:http://www.yuansir-web.com/2011/05/12/hello-world/测试环境:windows2003 32位 + Apache2.4 + PHP5.4 一.准 ...

  7. HDU2057 A + B Again

    Problem Description There must be many A + B problems in our HDOJ , now a new one is coming. Give yo ...

  8. 实验:实现https

    实现https 环境 1.三台主机分别为A,B,C. 2.A主机设置为CA和DNS服务器,ip为192.168.213.129 3.B主机为client,ip为192.168.213.253 4.C主 ...

  9. 史上最难的一道Java面试题 (分析篇)

    博客园 匠心零度 转载请注明原创出处,谢谢! 无意中了解到如下题目,觉得蛮好. 题目如下: public class TestSync2 implements Runnable { int b = 1 ...

  10. Golang:使用 httprouter 构建 API 服务器

    https://medium.com/@gauravsingharoy/build-your-first-api-server-with-httprouter-in-golang-732b7b01f6 ...