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. 记录maven 整合SSM框架

    一.新建maven项目 建好的项目结构如下图: 还需要做以下配置: 勾选上这两项后,就会自动生成 "src/main/java"   和 "src/main/resour ...

  2. 如何安装和配置 Rex-Ray?- 每天5分钟玩转 Docker 容器技术(74)

    Rex-Ray 是一个优秀的 Docker volume driver,本节将演示其安装和配置方法. Rex-Ray 以 standalone 进程的方式运行在 Docker 主机上,安装方法很简单, ...

  3. Linux学习——shell编程之环境变量配置文件

    小白学习,在学习中总结! shell编程之环境变量配置文件 一:环境变量配置文件 1 shell编程之环境变量配置 变量类型: 用户自定义变量(本地变量) 环境变量 :定义每个用户的操作环境,如pat ...

  4. mysql 时间函数 时间转换函数

    时间函数 Now 获取当前时间 current_timestamp 获取当前时间 localtimestamp 时间转换 UNIX_TIMESTAMP    "2009-09-15 00:0 ...

  5. http://codeforces.com/contest/610/problem/D

    D. Vika and Segments time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

  6. vue2组件之select2调用

    目前,项目中使用了纯前端的静态项目+RESTFul接口的模式.为了更好的对数据进行操作,前端使用了vue2的mvvm功能,但是由于不是单页面应用,所以,并没有涉及到其它的如vue-route等功能,也 ...

  7. SAP 条形码

    使用系统生成的条形码 正常的排列;将扫描由左到右.旋转对齐将从上到下扫描90度倒立定线将扫描所180度从右到左底部对齐将从底部到顶部270度扫描 但在实际应用中,条形码的大小不仅与此处有关,也与字符格 ...

  8. nginx 部署

    安装nginx 1)安装pcre 从pcre的官网下载tar.gz包,官网地址为:https://sourceforge.NET/projects/pcre/files/pcre/,在这里我下载的是: ...

  9. word遇到错误 使其无法正常工作 因此需要关闭word 是否希望我们立刻修复

    方法1: 网上找的方案: win10下按下快捷键win+R, 然后在里面输入 %appdata%\microsoft\templates ,确定,此时就会直接进入Word安装路径,在里面找到" ...

  10. Bootstrap表格样式(附源码文件)--Bootstrap

    1.表格默认样式 <h4>表格默认样式</h4><table><!--默认样式--> <tr><th>序号</th> ...