css3中的盒阴影的使用

css中的盒阴影的使用

我们可以利用阴影做出一些立体或者看起来动态的效果。

语法
box-shadow: h-shadow v-shadow blur spread color inset;
在这里插入图片描述
实例内部阴影和外部阴影

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.inner {
     
     
				width: 300px;
				height: 50px;
				line-height: 50px;
				margin: 100px auto;
				border: 1px solid #ddd;
				text-align: center;
				box-shadow: inset 0 0 10px #000;
			}
			
			.outer {
     
     
				width: 300px;
				height: 50px;
				line-height: 50px;
				margin: 260px auto;
				border: 1px solid #ddd;
				text-align: center;
				box-shadow:  0 0 10px #000;
			}
		</style>
	</head>
	<body>
		<div class="inner">哈哈哈哈哈哈哈哈哈哈哈啊哈哈</div>
		<div class="outer">哈哈哈哈哈哈哈哈哈哈哈啊哈哈</div>	
	</body>
</html>

在这里插入图片描述
加油吧!IT人

猜你喜欢

转载自blog.csdn.net/qq_41880073/article/details/115026573