<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body{
margin: 333px;
}
a{
display: inline-block;
font-size: 33px;
text-decoration: none;
border-radius: 23px;
padding: 20px 30px;
color: #ffffff;
background: linear-gradient(#cf9,#ffb3ff); /*默认从上到下*/
background: linear-gradient(to right,#CF9,#FFB3FF);
background: linear-gradient(to left bottom,#CF9,#FFB3FF); //需要去那个方向就填结束的方向, 可以指定多个颜色,可以指定每个颜色占得百分比
}
</style>
</head>
<body>
<a href="http://www.baidu.com">百度一下</a>
</body>
</html>
Css3-linear-gradient属性
最新推荐文章于 2024-01-24 15:55:18 发布