利用css新属性appearance优化select下拉框


 1 <!DOCTYPE html>
 2 <html xmlns="http://www.w3.org/1999/xhtml">
 3 <head>
 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 5 <title>利用css新属性appearance优化select下拉框</title>
 6 <style type="text/css">
 7 body{ padding:100px;}
 8 select{ border:1px solid #ccc; 
 9         padding-right:30px; 
10         appearance:none;
11         -moz-appearance:none; /* Firefox */
12         -webkit-appearance:none; /* Safari and Chrome */ 
13         background:url(images/ico.png) no-repeat right center;
14         }
15 select::-ms-expand {
16   display: none;
17 }
18 </style>
19 </head>
20 <body>
21 <select>
22 <option value="ec3bd039-f3a5-e411-8154-5404a6f3ab2f">所有分类</option>
23 <option value="bbf39f6f-f4a5-e411-8154-5404a6f3ab2f">食品</option>
24 </select>
25 </body>
26 </html>

收到网上一篇文章的启发:http://www.cnblogs.com/PeunZhang/p/3522603.html

 

 

posted @ 2015-01-29 20:49  冰糯鸢  阅读(1812)  评论(3编辑  收藏  举报