2013-01-14 87 views
0

可能重複:
CSS - gradient set for IECSS漸變爲所有Web瀏覽器

我設置樣式爲L1標籤和懸停

.centermenu li 
{ 
    position: relative; 
    float: right; 
    cursor: pointer; 
    height: 32px; 
    width: 152px; 
    margin: 10px 0 0 10px; 
    color: #fff; 
} 

    .centermenu li:hover, .centermenu li:focus 
    { 
     background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,.2)), to(rgba(255,255,255,0))); 
     background-image: -webkit-linear-gradient(top, rgba(255,255,255,.2), rgba(255,255,255,0)); 
     background-image: -moz-linear-gradient(top, rgba(255,255,255,.2), rgba(255,255,255,0)); 
     background-image: -ms-linear-gradient(top, rgba(255,255,255,.2), rgba(255,255,255,0)); 
     background-image: -o-linear-gradient(top, rgba(255,255,255,.2), rgba(255,255,255,0)); 
     background-image: linear-gradient(top, rgba(255,255,255,.2), rgba(255,255,255,0)); 
     } 

它在Firefox和GoogleChrom設置但不要在Internet Explorer中。

我爲IE設置了此代碼,但不設置樣式。

filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF 20%', endColorstr='#ffffff 1%'); 
    /* For Internet Explorer 8 */ 
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF 20%', endColorstr='#ffffff 1%')"; 
+1

internet expolorer不支持此,至少ie8和此 –

+0

過濾器:progid:DXImageTransform.Microsoft.gradient(startColorstr ='#cccccc',endColorstr ='#000000'); – skhurams

+0

我使用IE9和IE10但不工作。 – Niloo

回答

0

它不適用於舊的瀏覽器(如果我記得它是來自css3規範)。

讓它在更多的瀏覽器上工作你可以使用SVG背景,但它不是最好的方式。