Imagine a picture here

The shadow is not an image.
Two styles:

  • .theshadow draws a shaded box and
  • .castshadow offsets the block (parrot image, in this case) from its shadow.

View source to see how it's done:

<style type="text/css">
.theshadow {float:right; background-color:#cccccc; border:1px solid #d9d9d9; margin:10px;}
.castshadow {margin-left:-4px; margin-top:-4px;}
</style>


<div class="theshadow" style="width: 50px; height: 100px;">
 <img src="http://unverse.net/2parrots.jpg" alt="Imagine a picture here" style="width: 50px; height: 100px;" class="castshadow" />
</div>

Note that both the image and the containing div.theshadow must be styled with the same width and height.


Powered by Whizzy CMS