html background image fit to screen
snippet in html

how to cover full image in css

user5174

body {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

set background image full screen css

user1176

#mainBackground{
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    background-image: url("https://images.unsplash.com/photo-1487058792275-0ad4aaf24ca7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80");
    background-size:100% 100%;
    background-repeat: no-repeat;

}
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

html background image fit to screen

user4004

body {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}