017多背景+背景半透明

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>多背景</title>
	<style>
		div{
			width: 500px;
			height: 500px;
			/*background:url(icon3.png) no-repeat top left ,url(icon3.png) no-repeat bottom;*/   /*位置给不同*/
			background-color: blue;  /*多背景颜色在背景图片下面,防止被背景图片覆盖*/

			/*盒子背景半透明*/
			/*background-color: rgba(255,0,0,.3);    里面的字不会半透明。只有背景半透明*/
			opacity: 0.5;    /*与rgba的区别在于,里面的文字也会跟着背景半透明*/
		}
		div:hover{
			/*background-position: bottom right, top left; */
		}

	</style>
</head>
<body>
	<div>123</div>
</body>
</html>

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_40422393/article/details/89287928