为了账号安全,请及时绑定邮箱和手机立即绑定

用字体在网页中画ICON图标笔记总结

标签:
Html/CSS CSS3

图片描述
图片描述
链接:https://icomoon.io
代码链接:
https://gitee.com/sxianyuan/codes/v2l43w89u0djzoqr1a6gh95

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>用字体在网页中画ICON图标</title>
    <style type="text/css">
        li,ul{list-style:none}li{display:inline-block;margin:20px}a{display:block;margin:10px;text-decoration:none;color:#67006d;font-weight:700;font-size:18px}

        @font-face{
            font-family:"imooc-icon";
            src:url('fonts/icomoon.eot');/* IE9兼容模式 */
            src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'), /* ie8 */
                url('fonts/icomoon.woff') format('woff'),
                url('fonts/icomoon.ttf') format('truetype'),
                url('fonts/icomoon.svg') format('svg');
            font-weight:normal;
            font-style:normal;  
        }
        .imooc-icon{
            font-family:"imooc-icon";
            font-style: normal;
            font-weight: normal;
            font-size: 100px;
            -webki-t-font-smoothing:antialiased;
            -moz-osx-font-smoothing:grayscale;
        }
        .imooc-1{
            content: "\e906";
        }
        .imooc-2{
            position: relative;
        }
        .imooc-2:before{
            content: "\e902";
        }
        .imooc-2:after{
            content: "\e903";
            position: absolute;
            top:0;
            left:0;
        }
    </style>
</head>
<body>
    <h2>用字体在网页中画ICON图标</h2>
    <h4>链接:<a href="https://icomoon.io" target="_blank">https://icomoon.io</a></h4>
    <ul>
        <li><i style="color: red;" class="imooc-icon"></i></li>
        <li><i style="color: green;" class="imooc-icon"></i></li>
        <li><i style="font-size: 50px;" class="imooc-icon"></i></li>

        <li><i class="imooc-icon"></i></li>
        <li><i class="imooc-icon"></i></li>
        <li><i class="imooc-icon"></i></li>

        <li><i class="imooc-icon imooc-1"></i></li>
        <li><i class="imooc-icon imooc-2"></i></li>
        <li><i class="imooc-icon imooc-3"></i></li>
    </ul>
    <h4>参考链接</h4>
    <a href="http://www.iconfont.cn">http://www.iconfont.cn</a>
    <a href="http://fontello.com/">http://fontello.com/</a>
    <a href="http://fontawesome.io/">http://fontawesome.io/</a>
    <a href="http://flowerboys.cn/font/">http://flowerboys.cn/font/</a>
    <a href="http://www.w3cplus.com/css3/how-to-turn-your-icons-into-a-web-font.html">http://www.w3cplus.com/css3/how-to-turn-your-icons-into-a-web-font.html</a>
</body>
</html>
点击查看更多内容
1人点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
Web前端工程师
手记
粉丝
39
获赞与收藏
335

关注作者,订阅最新文章

阅读免费教程

感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消