CSS Image Drop Shadows
This examples shows how to add a drop shadow to any container element using CSS and the help of a large shadow image in the background. Virtually identical to the technique used to create a plain CSS shadow, the desired content is wrapped in a DIV with its background image set to an oversized shadow image. The content itself is relatively positioned and shifted slightly upwards and to the left to expose the shadow. A "master" DIV that surrounds the entire markup is also relatively positioned, but shifted to the right and downwards to return the entire markup to it's original position on the page.
IE 6 has difficultly handling nested relatively positioned elements (yada), so instead of letting IE6 ruin the fun for everyone else, we'll just use conditional HTML to hide the effect in that browser. IE7 is spared for finally learning proper CSS.
Note: If you're applying the shadow to an image, like in the second example below, you should give ".shadowcontainer" an explicit height reflecting that of the image's.
Demo:
Some title
Some text here. Some text here.
Some text here. Some text here.
Some text here. Some text here.
Some text here. Some text here.
Some text here. Some text here.
Some text here. Some text here.
Some text here. Some text here.
Some text here. Some text here.
Hi, I’m Jamie – Director of Outreach at Scripted.com. Thank you so much for the tops. They were really helpful. For writers, we have a ton of paid work at the moment. For content buyers, we have flat-rate purchase options for blog posts, tweets, and other types of content! We hope you give our service a shot – You can reach me directly with any questions at jamie@scripted.com
ReplyDelete