I am trying to add an image in the div style property, above which some text would be shown, Below is the code I wrote :
<div class="c-tile -red " style="background-image:url(@Html.Sitecore().Field("KfcStartContent_Img3"));">
<div class="c-tile__icon" style="background- image:url(@Html.Sitecore().Field("KfcStartContent_Img3"));">
<p class="c-heading -plus-x -secret-number"><small>#
</small>8-11</p>
</div>
<div class="c-tile__text">
<p class="c-heading -plus-x -secret-number"><small>#
</small>8-11</p>
<h3 class="c-heading -plus-x" style="color:black;">@Html.Sitecore().Field("KfcStartContent_Img3_Details")
</h3>
</div>
</div>
Which should have given the output as below :
But it is showing like this :
When I checked in developer tools, instead of just an url of image, some hash code is generated, by which my css styling are getting disabled and not showing the image .
I have used View rendering.