html中使用字体图标IcoMoon
时间:2023-04-08 16:37:00
大致步骤
- 在IcoMoon下载图标的压缩包
- css文件中的@font-face一段代码复制粘贴到style中
- 元素中的内容是文件夹。html复制粘贴中图标对应的口
- 元素样式设置font-family: ‘icomoon’;
DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>title> <style> @font-face {
font-family: 'icomoon'; src: url('fonts/icomoon.eot?r68z8y'); src: url('fonts/icomoon.eot?r68z8y#iefix') format('embedded-opentype'), url('fonts/icomoon.ttf?r68z8y') format('truetype'), url('fonts/icomoon.woff?r68z8y') format('woff'), url('fonts/icomoon.svg?r68z8y#icomoon') format('svg'); font-weight: normal
;
font-style: normal; font-display: block; } span {
font-family: 'icomoon'; font-size:100px; color:aquamarine; } style>
head>
<body>
<span>span>
body>
html>
对应的图标: