icomoon在css中如何声明以及使用方法

1.在样式表中声明,代码如下:

@font-face {
            font-family: 'icomoon';
            src:url('fonts/icomoon.eot');
            src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),                                
                url('fonts/icomoon.woff') format('woff'),
                url('fonts/icomoon.ttf') format('truetype'),
                url('fonts/icomoon.svg#icomoon') format('svg');
                font-weight: normal;
                font-style: normal;
        }

2.在要使用的标签中引用该字体:

div {
            font-family: "icomoon";
        }
        span::before {
            font-family: "icomoon";
            content: "\e900";
        }

猜你喜欢

转载自blog.csdn.net/g_hold/article/details/80024460