给body添加背景图
body {
line-height: 1;
background: url("./img/bg.jpg") no-repeat center fixed;
background-size: cover;
}
背景图颜色太浅,新增加一个div,在给此div设置颜色,透明度
<div id="block"></div>
/* 背景 */
#block{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.75);
z-index: -1;
}
一开始背景图
添加黑色和透明度后的背景图