I'm facing a challenge with passing a URL image from my HTML to my CSS in Angular, and I can't seem to figure it out:
Here is a snippet of my CSS:
card-profile_visual {
height: $visual-height;
overflow: hidden;
position: relative;
background: linear-gradient(to bottom, darken(#545559, 10%), saturate(darken(#3A4A7B, 2%), 20%), saturate(darken(#3A4A7B, 15%), 20%));
&:before,
&:after {
display: block;
content: '';
width: 100%;
height: 100%;
position: absolute;
z-index: 0;
background: url(myUrl) no-repeat center center/cover;
opacity: 0.5;
mix-blend-mode: lighten;
}
}
And here is the relevant part of my HTML:
<div class="card-profile_visual" [style.background-image]="'url('+offer.photo_url+')'"></div>
I'm seeking advice on how to successfully pass the offer.photo_url to the CSS property:
background: url(myUrl) no-repeat center center/cover;
Any guidance or assistance is greatly appreciated.