select自定义箭头样式

33 篇文章 3 订阅

select自定义箭头样式?兼容性?


html代码如下:

<div class="selectwrap">
	<div>类别</div>
	<select id="worktype">
		<option>最新流行音乐</option>
		<option>经典金属音乐</option>
		<option>潮流休闲音乐</option>
	</select>
</div>

css代码如下:

.selectwrap{
	width:100%;
	line-height: 28px;
	box-sizing: border-box;
	border: #626262 1px solid;
	color: #333;
}
.selectwrap div{
	float: left;
	height: 100%;
	text-align: center;
	background: url(../images/select_bgline.png) no-repeat right center;}
	.selectwrap select{
		width:290px;
		height: 100%;
		line-height: 28px;
		border-style: none;
		outline: none;
		font-family: "微软雅黑";
		font-size: 15px;
		font-weight: normal;
		box-sizing: border-box;
		
		/*Chrome和Firefox里面的边框是不一样的,所以复写了一下*/
		border: solid 1px #000;
		/*很关键:将默认的select选择框样式清除*/
		appearance:none;
		-moz-appearance:none;
		-webkit-appearance:none;
		/*在选择框的最右侧中间显示小箭头图片*/
		background: url(../images/arrow.png) no-repeat scroll 273px center transparent;
		/*为下拉小箭头留出一点位置,避免被文字覆盖*/
		padding-right: 18px;
		}

更改之后的select箭头效果如下:

这里写图片描述

兼容性处理参考代码。


以上就是关于“select自定义箭头样式”的全部内容。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值