问题描述
需要在选择选项标签中显示 Font Awesome 吗?
如果我使用外部它的工作 </i>
但是如果文本
<option value="line_graph">折线图</option><option value="pie_chart">饼图</option></选择>
你能帮我吗?
你不能在 (option tag) 里面使用 (icon tag),但是你可以像在 select 和 icon 类中使用 class='fa' 那样做在期权的价值.它在我的情况下完全有效.
<option value="fa fa-address-card">折线图</option><option value="fa fa-address-card">饼图</option></选择>
如果这不起作用,请确保这一点
.fa 选项 {字体粗细:900;}
希望对你有帮助.更好的是,我建议您在
Need to display Font Awesome in select options tag?
If i use outside Its working <i class="fas fa-chart-pie"></i>
But how can i display it in tag instead if text
<select id="select_graphtype">
<option value="line_graph"> Line Graph</option>
<option value="pie_chart"> Pie Chart</option>
</select>
Can you please help me out ?
You can't use (icon tag) inside (option tag), but you can do it differently like use class='fa' in select and icon classes in option's value. It's fully working in my case.
<select id="select_graphtype" class="fa">
<option value="fa fa-address-card">  line chart</option>
<option value="fa fa-address-card">  Pie Chart</option>
</select>
If this is not working please ensure this
.fa option {
font-weight: 900;
}
Hope this helps you. Better I would suggest you dashing frontend framework Materialize CSS select in this link.. I have been using it for my frontend works.
这篇关于如何在选择选项标签中显示图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!