ps:svg
font-family的名字能夠本身起字體
src是引入了4種字體,不用修改的url
1 @font-face { 2 font-family: 'icomoon'; 3 src: url('fonts/icomoon.eot?7kkyc2'); 4 src: url('fonts/icomoon.eot?7kkyc2#iefix') format('embedded-opentype'), 5 url('fonts/icomoon.ttf?7kkyc2') format('truetype'), 6 url('fonts/icomoon.woff?7kkyc2') format('woff'), 7 url('fonts/icomoon.svg?7kkyc2#icomoon') format('svg'); 8 font-weight: normal; 9 font-style: normal; 10 }
span { font-family: "icomoon"; }
<span></span>
或者
span::before { content: "\e900"; }