codecamp

径向渐变

语法: background:radial-gradient( center,shape,size,star- color,... ) 样式一: 默认方式以中心角开始到最远角。

<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body>
<div style="margin: 15px auto; width: 80px;height: 40px; background: radial-gradient(red,blue,yellow); class="change"> s </div> <hr /> <div style="margin: 15px auto; width: 80px;height: 80px; background: -webkit-radial-gradient(20% 30%,closest-side, red,blue,yellow); class="change">     靠近的边 </div> <hr /> <div style="margin: 15px auto; width: 80px;height: 80px; background: -webkit-radial-gradient(20% 30%,closest-corner, red,blue,yellow); class="change">     靠近的角 </div> <hr /> <div style="margin: 15px auto; width: 80px;height: 40px; background: -webkit-radial-gradient(circle, red,blue,yellow); class="change"> s </div> </body> </html>

渐变
2D,3D
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }