I'm attempting to dynamically adjust the height of my background in CSS. Currently, I have a fixed background that remains in place as I scroll down the page. However, when using a taller browser window, there appears to be a gap beneath the background image. My current CSS code is as follows:
body {
min-width: 100%;
background-image: url("Photos/Tiger-4.jpg");
background-position: 0px 0px;
background-size: 100%;
background-attachment: fixed;
background-repeat: no-repeat;
}
Current Background Appearance on Tall Browser [Img]
In the second image provided, you can see the undesired white gap under the background. My goal is for the background to zoom in on the image instead in order to enhance its display on mobile devices. Essentially, I want the background height to match the window height and the width to adjust proportionally without distorting the image.
I've attempted to resolve this issue by using:
background-size: auto 100%;
However, this resulted in an excessively large background image.
Any assistance would be greatly appreciated :)