Advanced Search Usage Terms Submit Contact
Dynamic Drive CSS Library
 
CSS Library
Submit an original CSS code
CSS Layouts
Web Graphics
Online Tools:

Advertise Here

CSS Library: DIVs and containers: Here

CSS Gradient Shadow

Author: Michael Burt

This is a CSS and JavaScript technique that lets you add a shadow to most elements on your page with a customizable shadow depth and coloring. Just give the element in question a class name of "shadow" to activate the effect.


The CSS:

The HTML:

Code Info

Rate this code:

Date Posted: 01/14/2007

Revision History: None

Usage Terms: Click here

Your Comments (62)

Got a question or need help customizing this CSS code? Post it in the CSS Forums. If you have a comment or suggestion instead, post it in the comments section below.

Comment Pages 6 of 7 pages « First  <  4 5 6 7 >

Thanks for this post.
Posted by rhamz on 02/17, 06:15 AM
Hm… This is really fresh idea of the design of the site! I seldom met such in Internet… Good Work!
Disk encryption software - Powerful encryption software with pre-boot authentication secures 100% of your hard disk drive, including the OS.
Posted by Disk encryption software on 03/01, 01:09 AM
Hi all, i used the code in a site that i make and i have a problem if the image that i apply the shadow effect is in a div that oveflows (appears the scrollbar on the side). When the above situation happens and you try to scroll down, the shadow remains pinned to the initial position.
Any comments on this?
Thanks
Posted by Sbile on 03/07, 04:05 AM
Is there any way to make this code work in anything else besides IE? I can "see" the drop shadow from my firefox browser here, but when I build it - nada. Any thoughts?
Posted by Mair on 03/22, 07:34 AM
never mind. I got it. Thanks
Posted by Mair on 03/22, 09:15 AM
I've been trying to assign the class="shadow" to different elements. I'm having trouble with only one - the table. It actually assigns the drop shadow TO the table, but it funks up and doesn't acknowledge anything inside of it. However, in IE the whole thing works perfect. It's just FF and safari that this happens to - in fact, in safari the whole table disappears. Am i missing something? (besides the fact that I am using tables and should be using div's - there's a reason for this that are to numerous to get into here) http://treasuretoursjamaica.com/experiment/dstest
Posted by Perplexed on 03/23, 06:04 AM
http://treasuretoursjamaica.com/experiment/screencap.htm
These are screencaps of what happens in each browser.

Weird eh?
Posted by Perplexed on 03/23, 06:37 AM
I like the script. Works perfectly on images, tables, etc. But I was wondering if this could be added to a css drop down menu. I've tried adding the (div class="shadow") and it works, but the shadow appears even before the menu drops down and stays after, never appearing only on mouse over which is what I want it to do. Now I've tried an "onmouseover" code, and it works, but the shadow doesn't appear, only the menu style. Any ideas?
Posted by John on 05/02, 02:21 AM
It's really nice. I got some diff idea and used in my site intelioftbd.com. Finally i saw this one is faster so i'm diverting to this.

------
Free SEO Text Brower
Posted by freelance seo expert on 05/05, 07:40 PM
find it on http://www.sristiconstructions.com
Posted by aaaa on 05/17, 12:13 AM

Comment Pages 6 of 7 pages « First  <  4 5 6 7 >

Commenting is not available in this weblog entry.
Copyright 2006-2011 Dynamic Drive Read our Usage Terms before using any of the CSS codes.