CSS渐变效果

一:线性渐变    属性--->linear-gradient

background-image: linear-gradient(circle , orange, green);


二:径向渐变  属性--->radial-gradient

background-image: radial-gradient(circle, orange, green);

两者都有repeating功能

效果:





index.html:

<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<title>CSS3渐变效果</title>
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div>我是HTML5</div>
</body>
</html>

style.css

@charset "utf-8";
div{
	width: 500px;
	height: 200px;
	/*background-color: green;*/

/*	background-image: linear-gradient( orange, green);
	background-image: linear-gradient( to top right, orange, green);*/

/*角度0-360逆时针*/
	/*background-image: linear-gradient(45deg, orange 0%, green ,blue,red 100%);*/

    /*background-image: linear-gradient( -45deg, orange , green,blue 250px,red);*/

    /*background-color: red;
    background-image: linear-gradient(to top right,rgba(0,0,0,0.6),rgba(0,0,0,0));
*/

    /*background-image: repeating-linear-gradient( orange 10px, green 30px);*/

    /*background-image: radial-gradient(circle, orange, green);*/

    /*background-image: radial-gradient(circle at top right, orange, green);*/

    /*background-image: radial-gradient(circle closest-side, orange, green);*/
    /*background-image: radial-gradient(circle , orange, green);*/
    background-image: repeating-radial-gradient(circle  20px, orange, green);
}
ppt:





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值