2016-02-29 52 views
0

我有这样的下拉按钮,这是使用这个CSS样式:定位的背景重复属性

.styled-select { 
     background: url(resources/img/selector.png) no-repeat right; 
     background-color: white; 
     width: 305px; 
     height: 42px; 
     position: relative; 
     margin: 0 auto; 
     box-shadow: 0 2px 2px 0 #C2C2C2; 
    } 

结果显示在这张照片:

enter image description here

正如你请参阅使用no-repeat right使selector.png转到右端。我想知道如果有位置的任何解决方案,以箭头转移一点是,以左侧为在这样的画面:

enter image description here

回答

1

尝试改变background-position属性value这样的:

background: url(resources/img/selector.png) no-repeat top 96%; 
+0

谢谢!工作:背景位置:98%50%; – reshad

+0

我会,我不知道为什么说我应该等6分钟:)) – reshad

0

你必须使用正确的欢迎使用属性这样

.styled-select { 
    background: url(resources/img/selector.png) no-repeat right; 
    background-color: white; 
    width: 305px; 
    height: 42px; 
    position: relative; 
    padding:10px; 
    margin: 0 auto; 
    box-shadow: 0 2px 2px 0 #C2C2C2; 
} 
+0

这会给整个盒子一个合适的空间,而不仅仅是箭头。 – reshad

+1

您是否尝试过整个填充属性? – Gopalakrishnan

+0

按照G.L.P.建议的背景位置解决。谢谢你的帮助。 – reshad