demo_fontclass.html 4.16 KB
Newer Older
吴雪燕's avatar
init  
吴雪燕 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>IconFont</title>
    <link rel="stylesheet" href="demo.css">
    <link rel="stylesheet" href="iconfont.css">
</head>
<body>
    <div class="main markdown">
        <h1>IconFont 图标</h1>
        <ul class="icon_lists clear">
            
                <li>
                <i class="icon iconfont icon-showpassword"></i>
                    <div class="name">show-password </div>
                    <div class="fontclass">.icon-showpassword</div>
                </li>
            
                <li>
                <i class="icon iconfont icon-user"></i>
                    <div class="name">user</div>
                    <div class="fontclass">.icon-user</div>
                </li>
            
                <li>
                <i class="icon iconfont icon-users"></i>
                    <div class="name">users</div>
                    <div class="fontclass">.icon-users</div>
                </li>
            
                <li>
                <i class="icon iconfont icon-3702mima"></i>
                    <div class="name">password-b</div>
                    <div class="fontclass">.icon-3702mima</div>
                </li>
            
                <li>
                <i class="icon iconfont icon-shangpin"></i>
                    <div class="name">06商品</div>
                    <div class="fontclass">.icon-shangpin</div>
                </li>
            
                <li>
                <i class="icon iconfont icon-danju"></i>
                    <div class="name">25单据</div>
                    <div class="fontclass">.icon-danju</div>
                </li>
            
                <li>
                <i class="icon iconfont icon-tijikongjian"></i>
                    <div class="name">28体积、空间</div>
                    <div class="fontclass">.icon-tijikongjian</div>
                </li>
            
                <li>
                <i class="icon iconfont icon-morentouxiang"></i>
                    <div class="name">225默认头像</div>
                    <div class="fontclass">.icon-morentouxiang</div>
                </li>
            
                <li>
                <i class="icon iconfont icon-baobiao"></i>
                    <div class="name">406报表</div>
                    <div class="fontclass">.icon-baobiao</div>
                </li>
            
                <li>
                <i class="icon iconfont icon-lock_fill"></i>
                    <div class="name">lock_fill</div>
                    <div class="fontclass">.icon-lock_fill</div>
                </li>
            
        </ul>

        <h2 id="font-class-">font-class引用</h2>
        <hr>

        <p>font-class是unicode使用方式的一种变种,主要是解决unicode书写不直观,语意不明确的问题。</p>
        <p>与unicode使用方式相比,具有如下特点:</p>
        <ul>
        <li>兼容性良好,支持ie8+,及所有现代浏览器。</li>
        <li>相比于unicode语意明确,书写更直观。可以很容易分辨这个icon是什么。</li>
        <li>因为使用class来定义图标,所以当要替换图标时,只需要修改class里面的unicode引用。</li>
        <li>不过因为本质上还是使用的字体,所以多色图标还是不支持的。</li>
        </ul>
        <p>使用步骤如下:</p>
        <h3 id="-fontclass-">第一步:引入项目下面生成的fontclass代码:</h3>


        <pre><code class="lang-js hljs javascript"><span class="hljs-comment">&lt;link rel="stylesheet" type="text/css" href="./iconfont.css"&gt;</span></code></pre>
        <h3 id="-">第二步:挑选相应图标并获取类名,应用于页面:</h3>
        <pre><code class="lang-css hljs">&lt;<span class="hljs-selector-tag">i</span> <span class="hljs-selector-tag">class</span>="<span class="hljs-selector-tag">iconfont</span> <span class="hljs-selector-tag">icon-xxx</span>"&gt;&lt;/<span class="hljs-selector-tag">i</span>&gt;</code></pre>
        <blockquote>
        <p>"iconfont"是你项目下的font-family。可以通过编辑项目查看,默认是"iconfont"。</p>
        </blockquote>
    </div>
</body>
</html>