0
我在IE中遇到問題,它沒有按照我希望的那樣顯示。IE漸變比預期更深
我創建了一個灰色漸變按鈕,當您將鼠標懸停在它上面時,它會變得稍暗。它在Firefox或Chrome中的顯示方式沒有問題,它似乎只是一個Internet Explorer問題。
HTML:
<input type="submit" value="Search" class="button1">
CSS:
.button1{
height:26px; font-family:verdana,arial, helvetica, sans-serif; font-size:12px; font-weight:bold;
cursor:pointer;
padding-left:10px; padding-right:10px; margin:2px;
border:1px solid #000; float:left;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background-color:#CCC;
background: rgb(254,255,232); /* Old browsers */
background: -moz-linear-gradient(top, rgba(254,255,232,1) 0%, rgba(214,219,191,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(254,255,232,1)),
color-stop(100%,rgba(214,219,191,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(254,255,232,1) 0%,rgba(214,219,191,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(254,255,232,1) 0%,rgba(214,219,191,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(254,255,232,1) 0%,rgba(214,219,191,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(254,255,232,1) 0%,rgba(214,219,191,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#feffe8', endColorstr='#d6dbbf',GradientType=0); /* IE6-9 */
}
.button1:hover{
background: -webkit-gradient(linear, left top, left bottom, from(#E6E6E6), to(#fff));/*for webkit*/
background: -moz-linear-gradient(top, #E6E6E6, #fff);/*for firefox*/
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#E6E6E6', endColorstr='#fff',GradientType=0);/*for IE*/
}
的jsfiddle: http://jsfiddle.net/Wg65Y/