I'm trying to style some cards in an mvc project and i have a custom property(variable) in my css "--bg-img" file as shown :
background-image: linear-gradient(rgba(0, 0, 0, var(--bg-filter-opacity)), rgba(0, 0, 0, var(--bg-filter-opacity))), var(--bg-img);
and in the cshtml file my code looks like this :
<a class="card-posting-link posting-links" asp-action="details" asp-route-id="@item.Id" style="--bg-img: url('../../wwwroot/Uploads/@item.ImagePath')">
in vs code everything is fine, example :
<a class="card-posting-link posting-links" href="/#/" style="--bg-img: url(/Assets/image.jpeg)">
I tried:
~/Uploads
~/wwwroot/Uploads
and many other ways to get the images but nothing worked.