Html
    Css
    Js

    
                        
 * {
	margin:0;
	padding:0;
}
#filter_treasure {
	width:160px;
	height:26px;
	border:1px solid #aaa;
	font-size:14px;
	color:#333;
	position:relative;
	margin:100px auto;
}
#filter_treasure .arrow_down {
	position:absolute;
	right:3px;
	top:10px;
	width:0;
	height:0;
	border-left:3px solid transparent;
	border-top:6px solid #000;
	border-right:3px solid transparent;
}
#filter_treasure .treasure_select {
	display:block;
	width:148px;
	height:26px;
	text-align:center;
	line-height:26px;
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
	cursor:default;
	border:0;
	outline:none;
}
#filter_treasure .treasure_all {
	width:159px;
	height:270px;
	background:#fff;
	position:relative;
	z-index:100;
	border:1px solid #aaa;
	overflow-y:auto;
	display:none;
}
#filter_treasure .treasure_all .treasure_name {
	width:150px;
	line-height:22px;
	margin:0 auto;
	overflow:hidden;
	text-overflow:ellipsis;
	white-space:nowrap;
	padding-left:2px;
}
#filter_treasure .treasure_all .treasure_name:hover {
	background:#1e90ff;
	color:#fff;
	cursor:default;
}
#filter_treasure .trea_selected {
	display:block;
}
#filter_treasure:hover {
	border-color:#7f7f7f;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:2.1.4
 立即下载

div模拟下拉框

0