<a target="_blank" href="http://www.cnblogs.com/kuikui/archive/2012/01/20/2327773.html">線性漸變(linear-gradient)</a>
現行漸變
首先看下示例
(1)垂直漸變

(2)垂直漸變
ie系列
filter: progid:dximagetransform.microsoft.gradient(startcolorstr='#ff0000',endcolorstr='#f9f900',gradienttype='0');
參數:startcolorstr起始顔色 endcolorstr結束顔色 gradienttype為0時代表垂直,為1時代表水準
firefox
background: -moz-linear-gradient(top, #ff0000, #f9f900);
參數:top、bottom垂直,left、right水準 例如:top時從頂部由#ff0000到#f9f900漸變,bottom時從底部由#ff0000到#f9f900漸變
opera
background: -o-linear-gradient(top,#ff0000, #f9f900);
webkit,如chrome、safari等
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ff0000), to(#f9f900));
參數:linear線性, x1 x2, x3 x4 x1與x3相同時垂直,x2與x4相同時水準 from起始顔色 to結束顔色
view
code