2 answers
points
If this DIV has a background image I recommend using an 'a' tag instead of using a DIV...
CSS:
a.image { background: url(image.jpg); width:200px; height:300px; display:block; cursor:pointer; }
HTML:
<a href="http://www.url.com" class="image"></a>
You want to do it this way so that it validates. You could put and 'a' tag outside the 'div' and set it to display:block, but then it won't validate as proper code.
- I agree with Juan. Do note that `display:block` is VERY important for it to work. `inline-block` will do so if you want inline layout.
- perfect. ill test is after i eat. thx.
point
sorry I forgot a quote after the link...
<a href="http://www.url.com" class="image"></a>
- Updated the code and formatting for you in the original answer. +1 from me!
