016 背景渐变

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<style>
	/*现在很少用到渐变,;浏览器问题,了解一下*/
	div{
		width: 300px;
		height: 100px;
		/*background:-webkit-linear-gradient(渐变起始位置,起始颜色,结束颜色);*/
		/*background:-webkit-linear-gradient(top,red,green);*/  /* 没有-webkit-  谷歌浏览器不支持,所以要加*/
		/*background:-webkit-linear-gradient(left,red,green);*/ 
		/*background:-webkit-linear-gradient(left top,red,green); */  /*从左上角到右下角*/

		/*background:-webkit-linear-gradient(渐变起始位置,颜色  位置,颜色 位置,颜色  位置);*/
		background:-webkit-linear-gradient(top,red 0%,green 50%,blue 100%); 
	}
	</style>
</head>
<body>
	<div></div>
</body>
</html>

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_40422393/article/details/89287891