gpt4 book ai didi

html - 获取 HTML 选择标签上的下拉箭头

转载 作者:行者123 更新时间:2023-11-28 06:16:29 24 4
gpt4 key购买 nike

我需要创建一个如下所示的选择框:

enter image description here

我的 HTML:

<select class="addSelect">
<option>Some Value</option>
<option>Some Value</option>
<option>Some Value</option>
</select>

我的 Sass/CSS:

.addSelect {
width: 100%;
background: #fff;
border: none;
@include border-radius(6px, 6px, 6px, 6px);
color: #9A9A9A;
@include appearance(none);
padding: 10px;
font-size: 16px;
}

所以到目前为止我有这样的东西:

enter image description here

非常接近我会说! (当然还没有颜色)。所以,我正在努力解决的问题是将那个向下的小箭头放在那里。当我说“外观:无”时,我有效地摆脱了那个下拉箭头..(虽然在 chrome 中它是一个向上和向下的箭头)......有什么提示吗?

最佳答案

你可以使用 fontawosme 图标的绝对位置来实现这一点

.select{
width:200px;
}
select{

width: 100%;
height: 30px;
display: block;
appearance: none;
-webkit-appearance: none;
padding: 0 20px;
line-height: 30px;
}
.select:before {
content: "\f078";
font-family: FontAwesome;
position: absolute;
z-index: 1;
right: 5px;
top: 6px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>
<div class='select'>
<select class="addSelect">
<option>Some Value</option>
<option>Some Value</option>
<option>Some Value</option>
</select>
</div>

关于html - 获取 HTML 选择标签上的下拉箭头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35861898/

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