add dynamic (no matter image size) shadow effect on images?
Is it possible to create a 1 pixel shadow image (say shadow.jpg) in photoshop, and then with PHP repeat that shadow just beneath or on the side of an image, for whatever the width or height of the target image is?
Example: If my image is 640x420 t开发者_如何学Gohen shadow.jpg will be repeated just beneath this image 640 times, thus creating a drop shadow effect!
Is this a good method?
If not, what other options are there to achieve the same thing?
Thanks
If you are just looking to style the image for display on the web, and not actually creating a new image using GD/etc. You could look into one of many CSS Drop Shadow Techniques.
- One Method
- Another Method
- A few more methods
CSS3 is bringing very nice shadow effects to current browsers if you don't mind the content degrading in unsupported browsers.
Here is a method for doing it in CSS.
http://www.wubbleyew.com/tests/dropshadows.htm
精彩评论