Axelology
Posted At : December 4, 2006 1:32 PM | Posted By : Axel Jensen

Use CSS to create a drop shadow

Short and to the point.


View the example

Download the File

<style>
<!--
#title{
   font-family:Arial, Helvetica, sans-serif;
   position:relative;
   top:5px;
   left:5px;
}
#text {
   color:#000000;
   position: relative;
   z-index:2;
   top:0;
   left:0;
}
#shadow {
   color:#999999;
   position:absolute;
   z-index:1;
   top:1px;
   left:1px;
}
-->
</style>

<body>
   <div id="title">
      <a href="#"><span id="text">Alice in Wonderland</span></a>
      <span id="shadow">Alice in Wonderland</span>
   </div>
</body>

Comments
Cool stuff! I wouldn't have thought of doing this. I wasn't seeing the drop shadow until I increased the font size to 40 and the top / left shadow positions to 3,3 ... then I saw the effect.

It would be interesting to know if screen readers for visually impared people would read the text twice. I wonder if there is a way around that also - then it would be perfect!
# Posted By Jason Troy | 12/4/06 9:27 PM



Blog provided and hosted by CF Webtools. Blog Sofware by Ray Camden.