Wednesday, May 16, 2012

How do I add a src in style class?

<div><img class="imgClose"></div>


I tried adding like this, but it does not show the image:



<style type="text/css">
.imgClose
{
float: right;
margin-top: -15px;
background: 16px 16px no-repeat url(_assets/img/close.png);
}
</style>


If I add in the HTML, then it works, but I would like to put the src in style class instead.



<div><img class="imgClose" src="_assets/img/close.png"></div>




No comments:

Post a Comment