placing image as div background

Posted by Lucka on Stack Overflow See other posts from Stack Overflow or by Lucka
Published on 2011-01-12T19:35:38Z Indexed on 2011/01/12 19:53 UTC
Read the original article Hit count: 119

Filed under:
|

How can I place only an image in a div as background image, and add url link to it. Currenty I'm doing it this way:

<div class="image"><a href="example.com"><img src="books.png" alt="Test" /></a></div>

I want to do something like following, but its not working (the image does not appear).

<div class="image"><a href="example.com"><span class="books"></span></a></div>

Thanks.

© Stack Overflow or respective owner

Related posts about html

Related posts about img