skip to content
Website Builder

Simple fluid drop shadows

Narrow

This is the text that goes in the middle.

Medium

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

Wide

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

architecture

A left positioned shadow

Medium

and finally a text box with a surround shadow.

A raised box

CSS play Support


CSS play Recommend

SitegrinderPSD to HTMLFree, practical CSS menus, layouts, and examplesuk white label shopping carts for resellers



Information

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 {
  display:block; 
  background:#bbb; 
  border:1px solid #ddd; 
  position:relative;
  margin:1em 0;
  }
.in {
  text-align:center; 
  background:#fff; 
  border:1px solid #555; 
  position:relative; 
  padding:5px;
  font-weight:normal;
  }
.ltin {
  left:-5px;
  }
.tpin {
  top:-5px;
  }
.narrow {width:8em;} /* change to suit */
h4 {font-weight:bold; color:#000;}

xhtml

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



Copyright

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.



CSS play Recommend

CSS play Testimonial

"The citroen.co.uk web site uses
CSS play code for the site drop down menus.
This code works seamlessly in IE 6 & 7, and is an excellent solution to the Creative requirements of the site."

Damon Clark - Brandwidth