感谢您的支持,我会继续努力的!
打开微信扫一扫,即可进行扫码打赏哦
点我查看本站打赏源码!
Powered by RUNCODEX.COM,学的不仅是技术,更是梦想!!!
<canvas id="myCanvas" width="200" height="100" style="border:1px solid #ccc"></canvas>
xxxxxxxxxx
var c = document.getElementById('myCanvas');
var ctx = c.getContext('2d');
var grd = ctx.createLinearGradient(0,0,200,0);
grd.addColorStop(0,'red');
grd.addColorStop(1,'blue');
ctx.fillStyle = grd;
ctx.fillRect(10,10,150,80);
输入 CSS 代码……