2014-03-19 23 views
0

我的IE8按鈕不能顯示,也許你知道爲什麼?嘗試添加背景:透明網址('..'),但沒有幫助。這是代碼:帶背景的HTML按鈕不顯示在IE8中

.wpcf7 input.wpcf7-submit { 
    background: url("/wp-content/themes/ASC/images/<?=ICL_LANGUAGE_CODE;?>_submit.png") no-repeat scroll center top rgba(0, 0, 0, 0); 
    border: 0 none; 
    cursor: pointer; 
    height: 25px; 
    margin: 0; 
    overflow: hidden; 
    padding: 25px 0 0; 
} 

button, 
input[type="button"], 
input[type="reset"], 
input[type="submit"] { 
    border: 1px solid #ccc; 
    border-color: #ccC#ccC#bbb #ccc; 
    border-radius: 3px; 
    background: #e6e6e6; 
    box-shadow: 0 0 0 0 black; 
    color: rgba(0, 0, 0, .8); 
    cursor: pointer; /* Improves usability and consistency of cursor style between image-type 'input' and others */ 
    -webkit-appearance: button; /* Corrects inability to style clickable 'input' types in iOS */ 
    font-size: 12px; 
    font-size: 1.2rem; 
    line-height: 1; 
    padding: .6em 1em .4em; 
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); 
} 
+0

不要告訴我這是在一個實際的CSS文件。 – putvande

回答

0

您已指定顏色值rgba。 IE8不承認這一點,所以它忽略了整個屬性。

使用透明而不是明確的顏色(你不能有兩個顏色)

background: transparent url("/wp-content/themes/ASC/images/<?=ICL_LANGUAGE_CODE;?>_submit.png") no-repeat scroll center top; 
+0

謝謝昆汀。 –

0

如果你仍然想使用其他瀏覽器的RGBA顏色值,你可以指定新的風格,只是爲了Internet Explorer的

<!--[if gte IE 8]> 
    <link rel="stylesheet" type="text/css" href="ie8-and-up.css" /> 
<![endif]--> 

由於昆汀的回答你可以改變RGBA爲十六進制的顏色並給予一定的TR謝謝

+0

有沒有必要訴諸瀏覽器檢測有[rgba fallback](http://dorward.me.uk/www/css/alpha-colour/)。而我的回答並不建議使用不透明度。 – Quentin

+0

大部分問題將通過創建僅限Internet Explorer樣式表來解決。這就是爲什麼我給了這個答案,是不透明是爲整個層,這是我的壞 –

+1

我很高興使用半透明,flexbox和其他新CSS的功能,並在IE8中正常降級,而不需要單獨的樣式表。 – Quentin