Here's the HTML code snippet:
<div class="whyimgbx">
<span class="partnerHospitals">
</span>
</div>
When I directly insert the image URL into the span tag, it works perfectly:
<span><img src="assets/images/1.png" alt=""></span>
However, when I include the class name in the span tag as shown below, it does not work:
Here is the corresponding CSS:
.partnerHospitals {
background-image: url(assets/images/1.png)!important;
}
Despite setting the partnerHospitals
class with the image, I am unable to see the image inside the span tag. Can anyone provide insights on why this might be happening?