I learned how to add a shadow to PNG images from the answers to this question. A user named Dudley posted this code which works for me except if Firefox (and an older version of Safari):
.shadowed {
-webkit-filter: drop-shadow(12px 12px 25px rgba(0,0,0,0.5));
filter: url(#drop-shadow);
-ms-filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=12, OffY=12,
Color='#444')";
filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=12, OffY=12,
Color='#444')";
}
<!-- HTML elements here -->
<svg height="0" xmlns="http://www.w3.org/2000/svg">
<filter id="drop-shadow">
<feGaussianBlur in="SourceAlpha" stdDeviation="4"/>
<feOffset dx="12" dy="12" result="offsetblur"/>
<feFlood flood-color="rgba(0,0,0,0.5)"/>
<feComposite in2="offsetblur" operator="in"/>
<feMerge>
<feMergeNode/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
</svg>
The code is based on this article. I added the code. I used it as-is except the values for OffX, OffY, and the rgb values. Additionally, I copied the CSS code in a a:hover section of the CSS shown below. (Note: I'd added the id tag change later to try to get it to work, but it didn't appear to work either).
#cssicons > ul > li > a:hover {
color: rgb(255,255,221);
id: shadowed;
-webkit-filter: drop-shadow(-2px 2px 3px rgba(0,0,0,0.5));
filter: url(#drop-shadow);
-ms-filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=2, OffY=2, Color='#444')";
filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=2, OffY=2, Color='#444')";
}
The HTML looks like this (truncated for brevity):
<link href="/icon_assets/styles.css" rel="stylesheet" type="text/css">
<div id='cssicons'>
<ul>
<li class='has-sub last'><a href='http://SwingBuffalo.com/'><span><IMG SRC="/images/swingbuffalo-tiny.png" WIDTH="40px" HEIGHT="40px" title="SwingBuffalo.com"></span></a></li>
<li class='has-sub last'><a href='http://RhythmShuffle.onbile.com/'><span><IMG SRC="/images/mobile.png" WIDTH="40px" HEIGHT="40px" title="Mobile Site"></span></a></li>
<li class='has-sub last'><a href='http://www.facebook.com/events/442624375809049/'><span><IMG SRC="/images/fb.png" WIDTH="40px" HEIGHT="40px"></span></a>
<ul>
<li><a href='https://www.facebook.com/sharer/sharer.php?u=www.RhythmShuffle.com&t=Rhythm%20Shuffle'><span>Share</span></a></li>
<li><a href='http://www.facebook.com/plugins/like.php?href=http%3A%2F%2FRhythmShuffle.com%2F&send=false&layout=standard&width=450&show_faces=true&font=trebuchet+ms&colorscheme=light&action=like&height=80'><span>Like</span></a></li>
<li><a href='http://www.facebook.com/events/442624375809049/'><span>RSVP</span></a></li>
<li class='last'><a href='http://www.facebook.com/SwingBuffalo/'><span>Swing Buffalo</span></a></li>
</ul>
</li>
...
<svg height="0" xmlns="http://www.w3.org/2000/svg">
<filter id="drop-shadow">
<feGaussianBlur in="SourceAlpha" stdDeviation="4"/>
<feOffset dx="2" dy="2" result="offsetblur"/>
<feFlood flood-color="rgba(0,0,0,0.5)"/>
<feComposite in2="offsetblur" operator="in"/>
<feMerge>
<feMergeNode/>
<feMergeNode in="SourceGraphic"/>
</feMerge>
</filter>
</svg>
The page containing the code is here. Anyone know what I'm doing wrong?
Thanks, Rob