Creating shadows in HTML

I would like to create shadows to an image in HTML, on the fly. It has to be on the fly, because the image will change (though the dimensions won't).

Can this be easily done?
1,855 views 4 replies
Reply #1 Top
Hmmm, Thats an interesting one. You could probably fake it by creating an image that was just the shadow portion and with the use of DHTML/Javascript place the shadow as needed and where you need it.

Reply #2 Top
Easy (if the image is rectangular) - put it in a table with the shadow in adjoining cells. It is/was possible to do this properly (proper blurred drop shadows with transparency) in IE, but it's one of the features noone ever used so they might have removed it.
Reply #3 Top
CSS2 has a dropshadow attribute. Not quite sure if this will also work on graphics (it was intended for text).
Reply #4 Top
Thanks for the replies. It looks like the table idea is probably the best for my needs.