CSS : 给背景图片加遮罩

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/qq_39115469/article/details/102776038
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>吉结号</title>
	<link rel="shortcut icon" href="image/g3.ico">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
	

	<style>
		body{
            margin: 0;
            padding: 0;
            background: url("2.png") center center no-repeat;
        }
        .zz:after{
            position: absolute;
            top: 0;
            left: 0;
            content: "";
            background-color: blue;
            opacity: 0.2;
            z-index: 1;
            width: 100%;
            height: 100%;
        }

	</style>
</head>

<body>
   <div class="zz">

        <div><h1>content</h1></div>

   </div>
</body>

</html>

猜你喜欢

转载自blog.csdn.net/qq_39115469/article/details/102776038