demo.html 6.85 KB

<!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">
        <h1>IconFont 图标</h1>
        <ul class="icon_lists clear">
            
                <li>
                <i class="icon iconfont">&#xe612;</i>
                    <div class="name">三角2</div>
                    <div class="code">&amp;#xe612;</div>
                    <div class="fontclass">.sanjiao2</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe613;</i>
                    <div class="name">三角1</div>
                    <div class="code">&amp;#xe613;</div>
                    <div class="fontclass">.sanjiao1</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe600;</i>
                    <div class="name">share</div>
                    <div class="code">&amp;#xe600;</div>
                    <div class="fontclass">.yoho-share</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe601;</i>
                    <div class="name">good</div>
                    <div class="code">&amp;#xe601;</div>
                    <div class="fontclass">.yoho-good</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe602;</i>
                    <div class="name">view</div>
                    <div class="code">&amp;#xe602;</div>
                    <div class="fontclass">.yoho-view</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe603;</i>
                    <div class="name">time</div>
                    <div class="code">&amp;#xe603;</div>
                    <div class="fontclass">.yoho-time</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe604;</i>
                    <div class="name">enter</div>
                    <div class="code">&amp;#xe604;</div>
                    <div class="fontclass">.yoho-enter</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe605;</i>
                    <div class="name">like</div>
                    <div class="code">&amp;#xe605;</div>
                    <div class="fontclass">.yoho-like</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe606;</i>
                    <div class="name">more</div>
                    <div class="code">&amp;#xe606;</div>
                    <div class="fontclass">.more</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe607;</i>
                    <div class="name">arrow-down</div>
                    <div class="code">&amp;#xe607;</div>
                    <div class="fontclass">.enter</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe608;</i>
                    <div class="name">up</div>
                    <div class="code">&amp;#xe608;</div>
                    <div class="fontclass">.up</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe609;</i>
                    <div class="name">down</div>
                    <div class="code">&amp;#xe609;</div>
                    <div class="fontclass">.downn</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe60a;</i>
                    <div class="name">gou</div>
                    <div class="code">&amp;#xe60a;</div>
                    <div class="fontclass">.gou</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe614;</i>
                    <div class="name">前进</div>
                    <div class="code">&amp;#xe614;</div>
                    <div class="fontclass">.qianjin</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe610;</i>
                    <div class="name">back</div>
                    <div class="code">&amp;#xe610;</div>
                    <div class="fontclass">.back</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe60f;</i>
                    <div class="name">search</div>
                    <div class="code">&amp;#xe60f;</div>
                    <div class="fontclass">.search</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe611;</i>
                    <div class="name">home</div>
                    <div class="code">&amp;#xe611;</div>
                    <div class="fontclass">.home</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe60b;</i>
                    <div class="name">menu-btn</div>
                    <div class="code">&amp;#xe60b;</div>
                    <div class="fontclass">.icon1</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe60c;</i>
                    <div class="name">point1</div>
                    <div class="code">&amp;#xe60c;</div>
                    <div class="fontclass">.point1</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe60d;</i>
                    <div class="name">logo2</div>
                    <div class="code">&amp;#xe60d;</div>
                    <div class="fontclass">.logo2</div>
                </li>
            
                <li>
                <i class="icon iconfont">&#xe60e;</i>
                    <div class="name">logo1</div>
                    <div class="code">&amp;#xe60e;</div>
                    <div class="fontclass">.logo1</div>
                </li>
            
        </ul>


        <div class="helps">
            第一步:使用font-face声明字体
            <pre>
@font-face {font-family: 'iconfont';
    src: url('iconfont.eot'); /* IE9*/
    src: url('iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
    url('iconfont.woff') format('woff'), /* chrome、firefox */
    url('iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
    url('iconfont.svg#iconfont') format('svg'); /* iOS 4.1- */
}
</pre>
第二步:定义使用iconfont的样式
            <pre>
.iconfont{
    font-family:"iconfont" !important;
    font-size:16px;font-style:normal;
    -webkit-font-smoothing: antialiased;
    -webkit-text-stroke-width: 0.2px;
    -moz-osx-font-smoothing: grayscale;}
</pre>
第三步:挑选相应图标并获取字体编码,应用于页面
<pre>
&lt;i class="iconfont"&gt;&amp;#x33;&lt;/i&gt;
</pre>
        </div>

    </div>
</body>
</html>