Info: I have a cropped image used as a background image for the top of my webpage. In CSS I've defined in px the size of a div containing the image - which is cropping the image. (I'm doing this in Squarespace). So when you enter the page you see the background image (and some text) filling the screen and you then scroll down past the image.
The problem: when I reduce the size of the web browser window the div, of course, maintains the same px height. This means the image ends up being background for most of the page - I just want it to be on the top when you enter the page.
The question: how do I make the cropping div responsive in height? As far as I have researched I can only set the value in px which isn't responsive-friendly... The following code is based on my external screen size. So I need that height px for large screens.
My code:
.header-background {
position: absolute;
top: -160px;
left: -335px;
right: -335px;
height: 850px;
z-index: -1;
overflow: hidden;
background-size: cover;
background-position: center;
background-image: img src('/s/Sams-sort.png')