I'm looking for a way to create an offset "picture frame" that would appear behind images on the site I'm building. Ideally, the frame would shrink/expand depending on the size of the photo.
You can see what I'm trying to accomplish at this link http://www.cmswebsolutions.com/girl.jpg. The frame is the beige in the background 16px wide offset by approx 15%.
Is there a way of doing this using CSS rather than tables? Thanks :-)
One way to do that would be two use two images: one for the tan offset, and one for the image. Then using absolute positioning place the tan offset where you want it, and then place the image 20px to the right and 20px lower than the tan image.
Another way is to nest the image inside a div tag and use the background color of the div to provide the offset:
<div><img src="image1.jpg" /></div>
In IE6, I initially tried this with a 50 x 50 px image:
I was able to find a similar solution on Phil Baines site at http://wubbleyew.com/tests/dropshadows.htm. It was much easier to find an answer once I realized I was looking for drop shadows. :-)
Still doing a bit of fine tuning to get it pixel perfect but here's my adaption so far:
Bookmarks