CSS Custom property Url isn't working in Asp .Net

87
July 27, 2021, at 10:10 PM

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.

READ ALSO
Load a Django Form into Template using jQuery?

Load a Django Form into Template using jQuery?

I am using Django function based views with a single template which contains multiple tabsDepending on which tab is selected I hide/show certain elements on the page by catching

92
Android webview app with keyboard up is not working, but with keyboard down it is working

Android webview app with keyboard up is not working, but with keyboard down it is working

In my android app, I am using web viewMy phone has an Android system webview version 91

119
How to add class to specific number of increment div&#39;s child in php?

How to add class to specific number of increment div's child in php?

As i am using a increment in PHP which output the number (1-unlimited) to div class ->

90