Simple fluid drop shadows

Pre 2006


This is the text that goes in the middle.


Another box that has a bit more text so that the box will be taller and the shadow stretches to suit.


One more text box that has a lot more text so that the box will be even taller and the shadow will still shadow to suit. The shadow color can be matched to the background and can also be positioned to the left or right.

Can be applied to images


A left positioned shadow


and finally a text box with a surround shadow.

A raised box

copyright © stu nicholls - CSS play


Nothing fancy or complicated this time. Just a simple way of producing drop shadows that are fluid and require NO graphics.

Cascading Style Sheet

.out {
  border:1px solid #ddd; 
  margin:1em 0;
.in {
  border:1px solid #555; 
.ltin {
.tpin {
.narrow {width:8em;} /* change to suit */
h4 {font-weight:bold; color:#000;}


<div class="out narrow">
  <div class="in ltin tpin">
    <p>This is the text that goes in the middle.</p>

Again, now that we have box shadow styles this is more or less redundant.


You may use this method on your personal 'non-profit' web site without seeking my permission. A link back to CSSplay is always appreciated.

Commercial usage is also permitted without seeking approval, but I would ask that a donation is considered to support my work on CSSPlay.

If you are having problems integrating any of my demonstrations into your website then I now offer a service to fault find and correct any errors that you may have introduced. Please email me for more information.

Please ask permission before using or copying this example to your web site.

Please Support CSS play

Please note that if your donation is for a demo/menu then you will need to email me with the url of the demo/menu after making the donation

For more CSS demonstrations I recommend that you visit the Dynamic Drive CSS Library.

Free, practical CSS menus, layouts, and examples

Soft Geometry Creative Industries

Soft Geometry Creative Industries
is a music-based design company located in Bristol UK.
I create artwork for albums, singles, posters and t-shirts.
My work is influenced by punk and post-punk poster and flyer design,
lo-fi photocopy aesthetics,
Francis Bacon and Mark Rothko.

I can provide a start to finish service with my own art and photography, put together work from images provided by yourself, and collaborate on an idea.

Follow CSS play

Facebook   Twitter   Facebook Fan Page