First step: background-size: cover;
Second step:
background-size: contain; background-repeat: no-repeat;
The third step is what I need: the first background image to be set as cover
and the second one as an overlay with no-repeat
Currently, my HTML includes a div
element:
<div class="news" data-background="@item.ImageUrl">
I have attempted some solutions but so far have only been able to add one image and not a duplicate of it.
How can I achieve a layout similar to the example on the right side of the image?
Additional details regarding the SCSS file:
.vertical .news {
position: relative;
box-sizing: border-box;
border-radius: 18px;
background-position: center;
background-size: cover;
background-color: $DarkTurquoise;
max-height: 85vh;
height: 80vh;
width: 30vw;
margin-bottom: 3vw;
margin-right: 1vw;
margin-left: 1vw;
overflow: hidden;
}