2016-08-12 172 views
1

我想插入結帳按鈕的背景圖像我正在使用下面的代碼將背景圖像移動到右側。把背景圖像放在右邊10px邊框帶邊框

HTML

<button type="submit" class="single_add_to_cart_button button alt disabled wc-variation-selection-needed">Add to basket</button> 

CSS

.woocommerce div.product form.cart .button { 
    width: 100%; 
    margin-top: 1px; 
    float: right; 
    height: 48px; 
    background-image: url(https://finnandsawyers.com/wp-content/themes/DiviSpace_14th_Feb_13_30/plus.png); 
    background-position: 150px; 
    background-size: 20px; 
    background-repeat: no-repeat; 
    background-position: 370px 15px; 
    cursor: pointer; 
} 

我正在尋找一種方法,把背景圖片在右側10px的保證金右邊界目前其沒有反應。

+0

保證金權:10px的 – chirag

+0

這裏是如何定位的背景圖像 - http://www.w3schools.com/cssref/pr_background-position.asp – Andrew

+0

使用'位置:absolute'和'右:10px的' – Pugazh

回答

0

感謝您的意見@chirag和安德魯。

您的意見真的幫助我解決了這個問題。

以下代碼解決了我的問題。

background-position: 95% 50%;