Using height
will be relative to your container, and using background-size: cover
will stretch your image to match the container, which why both of them don't guarantee the image will be at the size of full screen.
You can use vh
and vw
for that, like this:
.img {
height: 100vh;
width: 100vw;
background-size: cover;
background-repeat: no-repeat;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…