a href link for entire div in HTML/CSS

UPDATE 06/10/2014: using div’s inside a’s is semantically correct in HTML5. You’ll need to choose between the following scenarios: which is semantically incorrect, but it will work. which is semantically correct but it involves using JS. which is semantically correct and works as expected but is not a div any more.

How to display image with JavaScript?

You could make use of the Javascript DOM API. In particular, look at the createElement() method. You could create a re-usable function that will create an image like so… Then you could use it like this… See a working example on jsFiddle: http://jsfiddle.net/Bc6Et/