CSS3 实现border边框渐变

版权声明:JiahaoZhang原创文章,转载请注明出处 https://blog.csdn.net/GrootBaby/article/details/81938333
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>border</title>
	<style type="text/css">
		.box{
			width: 100px;
			height: 100px;
			border:10px solid #ddd;
			border-image: -webkit-linear-gradient(#ddd, #000) 30 30;
			border-image: -moz-linear-gradient(#ddd, #000) 30 30;
			border-image: -o-linear-gradient(#ddd, #000) 30 30;
			border-image: linear-gradient(#ddd, #000) 30 30;
		}
	</style>
</head>
<body>
	<div class="box"></div>
</body>
</html>

显示效果如下图:

猜你喜欢

转载自blog.csdn.net/GrootBaby/article/details/81938333