【发布时间】:2016-12-16 15:37:42
【问题描述】:
【问题讨论】:
-
您能否发布负责显示此下拉菜单的 CSS 和 HTML 代码。
-
您搜索过该网站吗?为什么这些解决方案不适合您?
-
选择{颜色:透明; -webkit-文本填充颜色:黑色; }
【问题讨论】:
试试这个代码段,
<div class="customerStyle">
<select class="selectCustomer">
<option value="Jone">Jone</option>
<option value="Tom">Tom</option>
</select>
</div>
.customerStyle select {
background: transparent;
width: 170px;
padding: 5px;
border: 0;
border-radius: 0;
height: 35px;
}
.customerStyle {
background: url("images/arrow.png") no-repeat right #ffffff;
border: 1px solid #000;
width: 150px;
height: 35px;
overflow: hidden;
}
为“images/arrow.png”添加蓝色箭头图像
【讨论】:
.select_box{
width: 200px;
overflow: hidden;
border: 1px solid #000;
position: relative;
padding: 10px 0;
}
.select_box:after{
width: 0;
height: 0;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-top: 6px solid #f00;
position: absolute;
top: 40%;
right: 5px;
content: "";
z-index: 98;
}
.select_box select{
width: 220px;
border: 0;
position: relative;
z-index: 99;
background: none;
}
<div class="select_box">
<select>
<option>Test This Select</option>
<option>Test This Select</option>
</select>
</div>
【讨论】:
pointer-events: none 用于select_box:after,否则当您准确地点击箭头时下拉菜单不会打开。 :-)