css - 在 Web 应用程序中使用新的自定义图标
问题描述
我使用Glyphter从自定义 SVG 文件创建图标。我现在正在尝试使用它,希望是这样的:
<i class='myIcon'></i>
但是仅仅将它作为字体系列添加到一个类中是行不通的。我似乎无法弄清楚如何使用它。我有生成的 CSS 文件:
@font-face {
font-family: 'Glyphter';
src: url('../fonts/Glyphter.eot');
src: url('../fonts/Glyphter.eot?#iefix') format('embedded-opentype'),
url('../fonts/Glyphter.woff') format('woff'),
url('../fonts/Glyphter.ttf') format('truetype'),
url('../fonts/Glyphter.svg#Glyphter') format('svg');
font-weight: normal;
font-style: normal;
}
[class*='icon-']:before{
display: inline-block;
font-family: 'Glyphter';
font-style: normal;
font-weight: normal;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale
}
.icon-clear-filter:before{content:'\0048';}
解决方案
推荐阅读
- go - Goji 子路由器返回 404
- c# - 在 asp.net 中使用 TemplateField 添加或删除行时,数据表为空
- python - QTreeView 与 QStandardItemModel:如何实现自己的排序模型
- r - R中具有无限和的修正贝塞尔函数
- android-emulator - 如何使用现有的 AOSP 源代码树在 Linux 上交叉编译适用于 Windows 的 Android 模拟器
- c# - 如何将 USB 视频类 (UVC) 转换为原始 USB 设备数据?
- aws-lambda - 无法在 Lambda 函数中创建 Kinesis 客户端
- wordpress - Woocommerce 商店侧栏在移动视图上移至底部
- swift - 使用 LSCopyApplicationURLsForBundleIdentifier 和 CFArrayGetValueAtIndex 获取应用程序的 URL/路径时出错
- r - 使用 purrr::map 在输出中获取多列