@MahdiSohaily
Posted
Hello dear, the issue you mentioned here can be solved using a CSS property called object-fit: cover
you can solve your issue by adding this block of code to your CSS
header {
position: relative;
background-color: hsla(277, 64%, 61%, 0.932);
}
.hero-image img {
width: 100%;
height: 100%;
object-fit: cover;
mix-blend-mode: multiply;
opacity: 0.8;
}
and also change your HTML to this
<picture class="hero-image">
<source srcset="./images/image-header-mobile.jpg" media="(max-width: 620px)">
<img src="./images/image-header-desktop.jpg" alt="Office Workers Smiling">
</picture>
if it was helpful mark my comment as helpful.
Marked as helpful