2016-02-29 37 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