Features

Drawbacks

Usage

This is in fact simple.

  1. Download and unnpack the library. You may place it wherever you like in your web directory.

  2. Link to the library's CSS file from your HTML:

    <link rel="stylesheet" href="/styles/trueshadows.css">
    
  3. Apply shadows:

    • Add class value "shadow" to desired elements. Remember you can just add shadows class to your already defined classes:

      <div id="info" class="center shadow">
      
    • Alternatively you can apply shadows based on your own stylesheet. For example if you want to add shadows to all elements with class "panel" add this rule to your CSS file:

      .panel {
        -moz-binding:url('/styles/trueshadows.xml#shadow');
      }
      

That's it!

Dynamically show/hide shadow

If you tried to remove shadow once cast on an element you've probably noticed that it's not enough to remove "shadow" value from element's class to make the shadow go away.

Instead you should use another value for class: "hiddenshadow". Here's a very simple (though not very practical) example how to show and hide shadow by clicking a mouse on an element:

<div onmousedown="this.className='shadow';" 
     onmouseup="this.className='hiddenshadow';">...</div>