CSS : 给背景图片加遮罩

<!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>

 

上一篇:javascript-半透明层,但点击进入较低层


下一篇:点击劫持