css3 渐变

css3 渐变

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
		html, body {
			height: 100%;
		}

		body {
			margin: 0;
			padding: 0;
			background-color: #f8fcd4;
			/*制作背景渐变效果*/
		/*	background-image: linear-gradient(
				to bottom,
				#f8fcd4 20%,
				#dbfacb 100%
			);*/
		}
		.nav {
			width: 800px;
			text-align: center;
			padding-top: 50px;
			margin: 0 auto;
		}

		/*设置按钮基本样式*/
		.nav a {
			display: inline-block;
			width: 100px;
			height: 30px;
			text-align: center;
			line-height: 30px;
			font-size: 14px;
			color: #fff;
			text-decoration: none;
			border: 1px solid #e59500;
			background-color: #FFB700;
			background-image: linear-gradient(
				to bottom,
				#FFB700 0%,
				#FF8C00 100%
			);
		}

		/*制作橙色按钮悬停效果*/
		.nav a:hover{
		background-color: #FFCB48;
			background: linear-gradient(
				to bottom,
				#FFCB48 0%,
				green 100%
			);
		}
	</style>
</head>
<body>
	<div class="nav">
		<a href="#;">refresh</a>
		<a href="#">shuffle</a>
		<a href="#">preview</a>
		<a href="#">tea</a>
		<a href="#">wifi</a>
		<a href="#">locator</a>
	</div>
</body>
</html>

在这里插入图片描述
鼠标悬停上面
在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>CSS 渐变</title>
	<style>
		body {
			margin: 0;
			padding: 0;
			background-color: #F7F7F7;
		}

		.progress {
			width: 400px;
			height: 40px;
			margin: 100px auto;
			border-radius: 5px;
			background-color: green;
			background-image: linear-gradient(
				135deg,
				yellow 25%,
				transparent 25%,
				transparent 50%,
				yellow 50%,
				yellow 75%,
				transparent 75%,
				transparent 100%
			);

			background-size: 40px 40px;
		}
	</style>
</head>
<body>
	<div class="progress"></div>

</body>
</html>

运行结果如下
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值