2011-11-24 35 views
0

我試圖創建一個形式input["text"]字段,但我得到這個白色邊框/背景四周,我不知道如何擺脫的。錯誤的自定義輸入背景[「文本」] CSS

任何人都可以幫助我嗎?

enter image description here

.my-form-login input[type="text"] { 
    background-image: url('../images/text-input.png'); 
    background-repeat: no-repeat; 
    outline: none; 
    width: 180px; 
    height: 30px; 
    border: none; 
    padding: 5px; 
} 
+0

這是否僅在Chrome上發生? – BoltClock

+0

嘗試將背景顏色設置爲透明 – Maheep

+0

如果您想要的只是圓角,請嘗試使用CSS3中的'border-radius'。 – Hauleth

回答

0

邊框的組合:0像素+設置背景色解決它

Althought將是巨大的,以將其設置爲透明...

謝謝大家。

.my-form-login input[type="text"] { 
    background-image: url('../images/text-input.png'); 
    background-repeat: no-repeat; 
    outline: none; 
    width: 180px; 
    height: 30px; 
    padding: 0px; 
    background-color: #444; 
    border: 0px; 
} 
1

使用background-color:[background color of parent tag];

+0

顯示白色背景的元素幾乎肯定是「輸入」 - 它具有白色的默認背景色。只需將背景色設置爲透明就可以完成大部分工作。 – BoltClock

+1

thnx BoldClock並且是輸入標籤,需要爲輸入標籤設置背景顏色。 – Dev