html中使用iconfont

可以通过网站 iconfont 选择并下载需要的图标,
解压后如下:
这里写图片描述
将其放入项目中,然后设置如下,注意路径设置

    <style type="text/css">
        @font-face {
            font-family: "iconfont";
            src: url('AmazeUI-2.7.2/fonts/iconfont.eot'); /* IE9*/
            src: url('AmazeUI-2.7.2/fonts/iconfont.eot#iefix') format('embedded-opentype'), /* IE6-IE8 */
            url('AmazeUI-2.7.2/fonts/iconfont.woff') format('woff'), /* chrome, firefox */
            url('AmazeUI-2.7.2/fonts/iconfont.ttf') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
            url('AmazeUI-2.7.2/fonts/iconfont.svg#iconfont') format('svg'); /* iOS 4.1- */
        }

        .iconfont {
            font-family: "iconfont" !important;
            font-size: 30px;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -webkit-text-stroke-width: 0.2px;
            -moz-osx-font-smoothing: grayscale;
        }
    </style>

然后就可以轻松使用了:

   <i class="icon iconfont">&#xe611;</i>

这里使用了AmazeUI框架

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值