在图像上添加动态(无论图像大小)阴影效果? [英] add dynamic (no matter image size) shadow effect on images?

查看:128
本文介绍了在图像上添加动态(无论图像大小)阴影效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在photoshop中创建1像素的阴影图像(比如shadow.jpg),然后使用PHP在图像的正下方或侧面重复该阴影,无论目标图像的宽度或高度如何?

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?

示例:如果我的图像是640x420,那么shadow.jpg将在此图像下方重复640次,从而产生阴影效果!

Example: If my image is 640x420 then shadow.jpg will be repeated just beneath this image 640 times, thus creating a drop shadow effect!

这是一个好方法吗?

如果没有,还有哪些其他选项可以达到同样的效果?

If not, what other options are there to achieve the same thing?

谢谢

推荐答案

如果您只想设置图像样式以便在网络上显示,而不是使用GD /等实际创建新图像。您可以查看其中一个 CSS Drop Shadow 技术。

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带来了非常好的阴影效果<如果您不介意不受支持的浏览器中的内容降级,请使用当前浏览器。

CSS3 is bringing very nice shadow effects to current browsers if you don't mind the content degrading in unsupported browsers.

这篇关于在图像上添加动态(无论图像大小)阴影效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆