css---颜色过渡渐变

时间:2023-12-17 20:48:08

CSS---颜色过渡渐变

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
*{margin:0px; padding:0px;}
.box{margin:20px 0px 0px 20px;}
.box1{width: 50%; height:15px; background: linear-gradient(to right, #f5911e 40%, #d91f2b, #d91f2b);}
.box2{width: 50%; height:15px; background: linear-gradient(to right, orange, #d91f2b);}
/*background: -webkit-linear-gradient(red 5%, green 15%, blue 60%);*/
</style>
</head>
<body>
<div class="box box1"></div>
<div class="box box2"></div>
</body>
</html>