mui自定义图标
来源:互联网 发布:华能贵诚信托 知乎 编辑:程序博客网 时间:2024/05/21 17:13
mui使用的图标并不是图片,并不是在img标签中显示的,而是在span标签中:
<span class="mui-icon iconfont icon-chuguofuwu">
从阿里图库中选择需要用到的图标,添加入库
点击购物车,你选择的图标都在,添加至项目。
然后会来到这个页面:
下载到本地,我们会看到下载的文件夹目录:
iconfont.css和iconfont.ttf是我们项目中需要用到的两个文件。
打开iconfont.css文件如下:
@font-face {font-family: "iconfont"; src: url('iconfont.eot?t=1481615719070'); /* IE9*/ src: url('iconfont.eot?t=1481615719070#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('iconfont.woff?t=1481615719070') format('woff'), /* chrome, firefox */ url('iconfont.ttf?t=1481615719070') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ url('iconfont.svg?t=1481615719070#iconfont') format('svg'); /* iOS 4.1- */}.iconfont { font-family:"iconfont" !important; font-size:16px; font-style:normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;}.icon-chuguofuwu:before { content: "\e730"; }.icon-qingjia:before { content: "\e619"; }.icon-639-copy:before { content: "\e63f"; }.icon-jisuanji:before { content: "\e60b"; }.icon-icon-copy:before { content: "\e602"; }.icon-zhengjianbanli:before { content: "\e636"; }.icon-chuchai:before { content: "\e671"; }.icon-shipinhuiyi:before { content: "\e600"; }.icon-cailiaoshenbao:before { content: "\e620"; }.icon-dangdiyongche:before { content: "\e603"; }.icon-peixun:before { content: "\e601"; }.icon-gerenpeixunxuqiu:before { content: "\e6fe"; }.icon-zhanghaobangdingyeyouxiang:before { content: "\e6b4"; }.icon-fuwu-02:before { content: "\e604"; }.icon-jiaban:before { content: "\e64c"; }
修改一下iconfont.css文件:
@font-face {font-family: "Muiicons"; font-weight: normal; font-style: normal; src:url('../fonts/iconfont.ttf') format('truetype'); /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ }.mui-icon{ font-family: Muiicons; font-size: 24px; font-weight: normal; font-style: normal; line-height: 1; display: inline-block; text-decoration: none; -webkit-font-smoothing: antialiased;}.icon-chuguofuwu:before { content: "\e730"; }.icon-qingjia:before { content: "\e619"; }.icon-639-copy:before { content: "\e63f"; }.icon-jisuanji:before { content: "\e60b"; }.icon-icon-copy:before { content: "\e602"; }.icon-zhengjianbanli:before { content: "\e636"; }.icon-chuchai:before { content: "\e671"; }.icon-shipinhuiyi:before { content: "\e600"; }.icon-cailiaoshenbao:before { content: "\e620"; }.icon-dangdiyongche:before { content: "\e603"; }.icon-peixun:before { content: "\e601"; }.icon-gerenpeixunxuqiu:before { content: "\e6fe"; }.icon-zhanghaobangdingyeyouxiang:before { content: "\e6b4"; }.icon-fuwu-02:before { content: "\e604"; }.icon-jiaban:before { content: "\e64c"; }
注意@font-face中src:url(‘../fonts/iconfont.ttf’) format(‘truetype’); 与iconfont.ttf文件在项目中的路径保持一致:
在项目中记得引入iconfont.css文件:
<link href="../resources/ui/mui-master/dist/css/iconfont.css" rel="stylesheet"/>
datagrid中某一列是mui图标:
{ field:'miconCls',title:'mui图标',width:130,align:'center', formatter:function(value,row,index){ return '<div id="'+row.id+'"><span class="mui-icon iconfont icon-chuguofuwu"></span></div>'; } },
自定义mui图标ok!
IE浏览器下不适用!
0 0
- mui自定义图标
- mui自定义图标
- mui增加自定义图标
- mui自定义图标
- mui app自定义图标
- mui如何增加自定义icon图标
- HTML5+DCloud--MUI--自定义tabbar图标
- MUI添加自定义icon图标 阿里巴巴矢量图标
- MUI实战开发第四集--如何增加自定义icon图标
- 详解MUI框架下添加自定义icon图标步骤
- HBuilder webApp开发(十五)MUI增加自定义icon图标
- mui toast自定义样式
- mui toast自定义样式
- MUI自定义事件
- mui 模拟自定义事件
- mui 图标显示不出来解决方案
- mui.prompt 样式修改/自定义
- mui.fire()触发自定义事件
- begin
- 深入理解 Spring 事务原理
- Solr 5.5.3配置ansj5.0.3
- C++创建多级目录及判断目录是否存在的方法
- 坦诚相待,学会感恩
- mui自定义图标
- [Canvas系列]Canvas简单线条绘制_02
- Rendering Problems 问题解决
- 创建Lists与Cards
- 1622-5 孔富晨 总结《2016年12月13日》 【连续第74天总结】
- Java自定义JRadioButton(重绘)
- Android布局优化之使用style提取重复使用属性
- 浅析HTMl5中的Web Storage:sessionStorage和localStorage
- 数字接龙