gpt4 book ai didi

html - Html 中的图标选择选项

转载 作者:行者123 更新时间:2023-12-02 19:14:42 25 4
gpt4 key购买 nike

我现在尝试了很多,但我无法解决它。我会像这里描述的那样尝试它:font awesome icon in select option

我想在我的选择中为某些选项添加一些很棒的字体图标我知道你不能在选项中添加 an 但我读到有使用 unicode 的可能性:

https://fontawesome.com/icons/sort-up这是我想与 unicode 一起使用的图标之一:f0de,我像这样插入它但没有任何效果我错过了什么?

<div class="sort_filter_container">
<div class="form-group">
<form name="view_type_sorting" class="form-group" action="" method="get">
<span><b>[{oxmultilang ident="SORT_VIEW"}]: </b></span>
<select style="text-align-last: center;font-weight: 600;margin-right: 0;vertical-align: text-bottom;" id="view_type_sorting" aria-haspopup="true" aria-expanded="false" onchange="this.form.submit()" name="view_type_sorting">
<option id="list_asc_price" name="list_asc_price" value="list_asc_price">[{oxmultilang ident="PRICE_UP"}] &#xf09b;</option>
<option id="list_desc_price" name="list_desc_price" value="list_desc_price">[{oxmultilang ident="PRICE_DOWN"}]</option>
<option id="list_asc_alpha" name="list_asc_alpha" value="list_asc_alpha">[{oxmultilang ident="NAME_UP"}]</option>
<option id="list_desc_alpha" name="list_desc_alpha" value="list_desc_alpha">[{oxmultilang ident="NAME_DOWN"}]</option>
<option id="list_default" name="list_default" value="list_default">[{oxmultilang ident="DEFAULT_GRID"}]</option>
</select>
</form>
</div>
</div>

最佳答案

我使用 Fontawesome version 4.7.0

将字体系列添加到 #view_type_sorting

#view_type_sorting{
font-family:"FontAwesome";
}

#view_type_sorting{
font-family:"FontAwesome";
font-size:14px;
}
#view_type_sorting::before{
vertical-align:middle;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<div class="sort_filter_container">
<div class="form-group">
<form name="view_type_sorting" class="form-group">
<select style="text-align-last: center;font-weight: 600;margin-right: 0;vertical-align: text-bottom;" id="view_type_sorting" aria-haspopup="true" aria-expanded="false" name="view_type_sorting">
<option id="list_asc_price" name="list_asc_price" value="list_asc_price"> Github &#xf09b; </option>
<option id="list_desc_price" name="list_desc_price" value="list_desc_price"> GitLab &#xf296; </option>
<option id="list_asc_alpha" name="list_asc_alpha" value="list_asc_alpha"> Whatsapp &#xf232;</option>
<option id="list_desc_alpha" name="list_desc_alpha" value="list_desc_alpha"> Google Plus &#xf0d5; </option>
<option id="list_default" name="list_default" value="list_default"> Facebook &#xf082; </option>
</select>
</form>
</div>
</div>

关于html - Html 中的图标选择选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63812812/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com