[英]Font Awesome Icon Not Showing In Selectbox
I am creating a front end project but my icons has not been displayed in UI.我正在创建一个前端项目,但我的图标没有显示在 UI 中。 I tried  code and set my select font-family to 'Font Awesome 5', however, it has not been displayed again.
我尝试了  代码并将我的 select 字体系列设置为“Font Awesome 5”,但是,它没有再次显示。
select { font-family: 'FontAwesome 5 Free', 'sans-serif'; } @font-face { font-family: "FontAwesome 5 Free"; src: url("http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.eot?v=4.3.0"); }
<select> <option value="public">Hi, </option> </select>
I also tried 'FontAwesome' instead of 'FontAwesome 5 Free'.我还尝试了“FontAwesome”而不是“FontAwesome 5 Free”。 It didn't work though.
但它没有用。
Are you aware that the eot
font format is only supported by Inte.net Explorer?您知道只有 Inte.net Explorer 支持
eot
字体格式吗?
You should probably embed the woff
/ woff2
version.您可能应该嵌入
woff
/ woff2
版本。
As soon as I change eof
to woff
or woff2
in the CDN URL you are loading the font from, it works fine in my Chromium-based browser - https://jsfiddle.net/bwj04qr2/一旦我在 CDN URL 中将
eof
更改为woff
或woff2
,你就会从中加载字体,它在我基于 Chromium 的浏览器中工作正常 - https://jsfiddle.net/bwj04qr2/
select { font-family: 'FontAwesome 5 Free', 'sans-serif'; } @font-face { font-family: "FontAwesome 5 Free"; src: url("http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.woff?v=4.3.0"); }
<select> <option value="public">Hi, </option> </select>
I am creating a front end project but my icons has not been displayed in UI.我正在创建一个前端项目,但我的图标没有显示在 UI 中。 I tried  code and set my select font-family to 'Font Awesome 5', however, it has not been displayed again.
我尝试了  代码并将我的 select 字体系列设置为“Font Awesome 5”,但是它没有再次显示。
select { font-family: 'FontAwesome 5 Free', 'sans-serif'; } @font-face { font-family: "FontAwesome 5 Free"; src: url("http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/fonts/fontawesome-webfont.eot?v=4.3.0"); }
<select> <option value="public">Hi, </option> </select>
I also tried 'FontAwesome' instead of 'FontAwesome 5 Free'.我还尝试了“FontAwesome”而不是“FontAwesome 5 Free”。 It didn't work though.
但它没有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.