BetterWindowsSoftware.com - find freeware or shareware
Preview styles

CSS shadow for image

PHP Source Code

Download zip file of the PHP source code: css_shadow.zip
Show source code
Rate Our Program
Excellent!
Very Good
Good
Fair
Poor


hyperlink Permalink with no parameters passed
Image URL
"alt=" image tag value
Background Color  spacer
Shadow Color
blank will use the average color of the image
 spacer
Blend Strength (1 to 10)
Shadow Distance (1 to 20)
Override Width
Override Height

What Can this CSS shadow web form do?

If you need a shadow for an image that doesn't require using any graphics library calls, you can simply use this form to generate the HTML for any image you might have. Creates a smoothly blended shadow for your images without using any Flash, JavaScript, or PHP graphics rendering calls. The trick is creative use of CSS style properties to define the shadow using <div> elements with different sizes and colors. The function automatically calculates the width and height for any JPG, GIF, or PNG images, but does not calculate correctly for other image types as it is currently written; for these file types, you should supply the values for override width and override height.

Do you want to make a shadow for a DIV section instead?
CSS shadow for DIV

The result is 100% valid HTML code around your image object. This unit does use some graphics library calls to get the size (and color of the image if no Background Color is specified). You can simply copy and paste the HTML to display your image with whatever shadow options that you set.

Also, after you've used the form a permalink is created - in the event that you wanted a link of this page that shows your output.

HTML Code

This area would normally display the HTML code that displays an image with a shadow, but there isn't a valid image yet. You can set the parameters for the "getImageWithCSSShadow" function call by using the form above. Be sure that the image uses a valid and full URL (include "http://").

Source Code for this CSS shadow

You could also download the source code for the tool and use the code to create different shadow effects for images dynamically.

The source code only handles images, but could easily be rewritten to handle other objects (tables, paragraphs, blockquotes, etc.) as long as they have a set width and height.