【发布时间】:2015-04-08 21:34:50
【问题描述】:
我在这里创建了小提琴,它显示了选择和下拉箭头。
我的问题是箭头是使用 CSS 创建的并位于选择的顶部。 但是点击箭头不会打开下拉菜单。
- 有没有办法像我们使用图像箭头时那样使用该 css 作为选择的背景。
- 或者是否可以模拟箭头点击的行为?
.selectClass {
-webkit-appearance: none;
-webkit-border-radius: 0;
-moz-appearance: none;
border: none;
width: 100px;
background: #EEE;
height: 30px;
font-size: 20px;
padding-left: 5px;
}
.dropDownArrow {
position: relative;
margin-left: 75px;
margin-top: -20px;
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 10px solid #555;
}
<select class="selectClass">
<option>One</option>
<option>Two</option>
<option>Three</option>
</select>
<div class="dropDownArrow"></div>
【问题讨论】: