OpenMeyends
OpenMeyends

Reputation: 129

full page background cuts off when browser resized to xs (mobile size)

html, body {
  background-image: url("http://getwallpapers.com/wallpaper/full/e/9/4/629789.jpg");
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

here is the code Ihave so far.

When browser in lg md the background pic covers the whole browser but when resized to sm or xs the picture is cut off and there is white background near the bottom of page.

Upvotes: 0

Views: 27

Answers (1)

doğukan
doğukan

Reputation: 27491

i hope this is be helpful.

html, body {
  background-image: url("http://getwallpapers.com/wallpaper/full/e/9/4/629789.jpg");
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@media screen and (max-width:1024px){
  html, body {
  background-attachment:fixed;
}
}

Upvotes: 1

Related Questions