My fullwidth div has an image that overlaps it. When the browser is resized, more of the image is either shown or hidden without resizing the actual image itself. I managed to get this effect for the width, but how can I achieve the same result for the height?
Here is the test I conducted: https://jsfiddle.net/g8h8umt3/
I successfully adjusted the width using CSS:
#img-header{
margin-left: 50%;
transform: translateX(-50%);
}
EDIT:
Here is an illustration of how it should work: Image
The background image should maintain its size while the parent div adjusts accordingly based on the screen size. I figured out the behavior for the width, but I'm unsure how to do the same for the image's height.
I also attempted to add:
#img-header{
margin-top: 50%;
margin-left: 50%;
transform: translate(-50%,-50%);
}
However, this solution doesn't seem to be effective.