Select标签中的向下箭头图标

3

您好,我想知道如何将以下代码添加到页面中:

http://jsfiddle.net/Torrecilla/Yv6zx/3/

这个箭头应该放在页面右侧:

select arrow

这可行吗?我无法弄清楚。

<select name="cats" id="cats">
  <option value="">All the Categories</option>
  <option value="">Cat 1</option>
  <option value="">Cat 2</option>
  <option value="">...</option>
</select>

CSS

body {
    margin-top:20px;
    margin-left:20px;
}
select {
    padding:3px;
    margin: 0;
    border-radius:4px;
    -webkit-box-shadow: 
        0 0px 0 #ccc,
        0 0px #fff inset;
    background: -moz-linear-gradient(top, #FBFBFB 0%, #E9E9E9 100%);background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FBFBFB), color-stop(100%,#E9E9E9));
    color:black;
    border:none;
    outline:none;
    display: inline-block;
    -webkit-appearance:none; 
    cursor:pointer;
    border: 1px solid #ccc;
}
1个回答

3
是的,这是可以实现的!尝试以下方法: CSS:
background: url('http://i45.tinypic.com/309nb74.png') no-repeat right, -moz-linear-gradient(top, #FBFBFB 0%, #E9E9E9 100%);
background: url('http://i45.tinypic.com/309nb74.png') no-repeat right, -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FBFBFB), color-stop(100%,#E9E9E9));

你需要调整填充,但是你已经明白了思路。
演示: http://jsfiddle.net/Yv6zx/24/

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接