颜色rgba、hsla
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
body {
margin: 0;
padding: 0;
background: url(./images/bg.jpg);
}
.layer {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
/*background-color: rgba(0, 0, 0, 0.3);*/
background-color: hsla(0, 10%, 10%, 0.3);
/*opacity: 0.3;*/
/*width: 100%;
height: 100%;*/
}
</style>
</head>
<body>
<div class="layer">
<img src="./images/layer.jpg" alt="">
</div>
</body>
</html>