Using the following css, I am trying to use the attached image as a background image. I expected the image to resize in a scalable way as I made the browser smaller, however, at 600px the woman's head is no longer visible. In other words, instead of reducing the proportions of the contents of the image (i.e. scaling down) the css is simply cutting off the right side of the image. Is there a way to scale down the image rather than have the css cut off the right side of it when reducing browser size?
html {
height: 100%;
}
body {
font-family: Lato, sans-serif;
color: #333;
font-size: 15px;
line-height: 23px;
font-weight: 300;
}
.hero-section {
width: 100%;
background-image: url('./3479295472_7d97d686e4_b_couple.jpg');
background-position: 50% 45%;
background-size: cover;
}
<div class="hero-section">
<div class="hero-overlay-section">
<div class="container hero-container w-container">
<h1 class="hero-title" data-ix="hero-fade-in" style="opacity: 1; transform: translateX(0px) translateY(0px) translateZ(0px); transition: opacity 500ms, transform 500ms;">Jim</h1>
<h1 class="and hero-title" data-ix="hero-fade-in-2" style="opacity: 1; transition: opacity 1500ms;">&</h1>
<h1 class="hero-title" data-ix="hero-fade-in-3" style="opacity: 1; transform: translateX(0px) translateY(0px) translateZ(0px); transition: opacity 500ms, transform 500ms;">Karen</h1>
<div class="hero-divider-line" data-ix="hero-fade-in-4" style="opacity: 1; width: 120px; transition: opacity 500ms, width 500ms;"></div>
<div class="hero-date-wrapper">
<h2 class="hero-date-title" data-ix="hero-fade-in-5" style="opacity: 1; transition: opacity 500ms;">November 5th, 2018</h2>
</div>
</div>
</div>
</div>
Note, according to a comment on this SO question background-size
should help but it's not in my case.
Update:
I have also tried with and got the same results (the woman's head is cut off once I reduce the browser size).
background-size: contain;
background-repeat: no-repeat;