html - 如何在本地工作时在 HTML 文件中显示 SVG Sprite 图标?
问题描述
我正在使用 SVG 图标(来自 IcoMoon),问题是我在本地工作时看不到图标,但是当我在线上传页面时它工作正常。
<!doctype html>
<html>
<head>
<title>SVG Icons</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<svg class="ico ico-menu"><use xlink:href="icons/symbol-defs.svg#ico-menu"></use></svg></td>
<script defer src="icons/svgxuse.min.js"></script>
</body>
</html>
我没有使用任何本地服务器。它是一个纯 HTML 文件。我想知道如何解决这个问题?
谢谢你
解决方案
推荐阅读
- javascript - node-cron 是否并行运行任务?
- bootstrap-4 - 菜单悬停未正确关闭
- c# - azure 聊天机器人的前端源文件在哪里?
- spring-boot - 如何使春季会话在多个请求中持续存在?
- reactjs - 如何确保使用 `gcloud app deploy` 使用的是我的构建文件夹而不是我的开发文件?
- android - 我们可以将 JitsiMeetView 添加到我们的自定义布局中吗?
- javascript - 我如何(并且应该)在 DOM 对象上创建其他方法?
- android - 如何修复错误“无法实例化服务 *<*.TimerIntentService> 没有零参数构造函数”
- python - 如何使用 xlsxwriter 模块在多个单元格中的 Excel 中动态编写公式?
- reactjs - React Typescript:使用 BrowserRouter 的通配符路由