【发布时间】:2015-10-26 22:01:01
【问题描述】:
我想要一个带有很棒的字体图标和图标名称的选择框。 我在 Code behind 中动态地为 DropDownList 构建我的 ListItems,并希望显示带有 unicode 的图标。 这是我的输出:
DropDownList 的声明如下所示:
<asp:DropDownList ID="ddl_Icons" CssClass="form-control select2 fontawesomeselect" runat="server"></asp:DropDownList>
字体系列应该是正确的,但仍然没有显示图标。 有什么提示可以显示图标吗?
我正在使用 select2 并制作了两个包含以下代码的 CSS 类:
<style type="text/css">
.fontawesomeselect {
font-family: 'FontAwesome', 'Arial';
}
.select2-selection__rendered{
font-family: 'FontAwesome', 'Arial';
}
</style>
【问题讨论】: