Rumah  >  Artikel  >  hujung hadapan web  >  CSS常用渐变

CSS常用渐变

WBOY
WBOYasal
2016-09-21 13:56:061202semak imbas

边框渐变:

<span style="color: #008080;">1</span> <span style="color: #800000;">border-image: -webkit-linear-gradient( red , blue) 30 30;
</span><span style="color: #008080;">2</span> <span style="color: #800000;">border-image: -moz-linear-gradient( red, blue) 30 30;
</span><span style="color: #008080;">3</span> <span style="color: #800000;">border-image: linear-gradient( red , blue) 30 30;</span>

 

文字渐变:(只支持-webkit-)

<span style="color: #008080;">1</span> <span style="color: #800000;">background-image: -webkit-gradient(linear, 0 0, 0 80%, from(nth($color7, 3)), to(nth($color7, 4)));
</span><span style="color: #008080;">2</span> <span style="color: #800000;">-webkit-background-clip: text;
</span><span style="color: #008080;">3</span> <span style="color: #800000;">-webkit-text-fill-color: transparent;</span>

 

背景渐变:

<span style="color: #008080;">1</span> <span style="color: #800000;">filter: alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=red,endcolorstr=blue,gradientType=0);
</span><span style="color: #008080;">2</span> <span style="color: #800000;">-ms-filter: alpha(opacity=100 finishopacity=50 style=1 startx=0,starty=0,finishx=0,finishy=150) progid:DXImageTransform.Microsoft.gradient(startcolorstr=red,endcolorstr=blue,gradientType=0);  
</span><span style="color: #008080;">3</span> <span style="color: #800000;">background: red; </span><span style="color: #008000;">/*</span><span style="color: #008000;"> 一些不支持背景渐变的浏览器 </span><span style="color: #008000;">*/</span>  
<span style="color: #008080;">4</span> <span style="color: #800000;">background: -moz-linear-gradient(top, red, blue);  
</span><span style="color: #008080;">5</span> <span style="color: #800000;">background: -webkit-gradient(linear, 0 0, 0 bottom, from(red), to(blue));</span>

 

 

 

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn