css - 背景图像在 CSS 中四处移动
问题描述
我有一个图像设置为我的标题的背景。当我在 chrome 中调整窗口大小时,图像会四处移动(围绕图像的不同区域移动)
下面是我的CSS:
#home::before { /* issue that the image moves as the window is resized */
content: "";
background: url('../images/beach.JPG') no-repeat 0 500px;
background-size: cover;
position: absolute;
bottom: 0;X
top: 0;
left: 0;
right: 0;
height: 900px;
width: 100%;
z-index: -1;
opacity: ;
}