[CSS3/IE filter] 漸層背景 Gradient Background |
Moderator October 29, 2011 04:44PM 發表文章數: 1,229 |
/*由上到下*/ background:-webkit-gradient(linear, left top, left bottom, from(#00475E), to(#007276)); /*由左至右*/ background:-webkit-gradient(linear, left top, right top, from(#00475E), to(#007276)); /*在Chrome 10 之後語法可簡化為:*/ background:webkit-linear-gradient(top, #00475E, #007276);Firefox 3.6+
/*由上到下*/ background:-moz-linear-gradient(top, #00475E, #007276); /*由左至右*/ background:-moz-linear-gradient(left, #00475E, #007276);IE6~IE8
body { /*預設背景顏色, 讓不支援漸層的瀏覽器能呈現基本底色*/ background: #278092; /******跨瀏覽器的底色漸層CSS語法 (由上到下)********/ /*Chrome的語法*/ background:-webkit-gradient(linear, left top, left bottom, from(#00475E), to(#007276)); /*FireFox的語法*/ background: -moz-linear-gradient(top, #00475E, #007276); /*IE6~IE8的語法*/ filter: progid: DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#00475E', endColorstr='#007276'); /* Opera 11.10+ */ background: -o-linear-gradient(top, #00475E, #007276); margin: 0px; }