简体   繁体   English

如何在像这样的图像下制作一个小的“阴影”?

[英]How do I make a tiny 'shadow' under an image, like this one?

http://www.deviantart.com/#order=9&q=sun http://www.deviantart.com/#order=9&q=sun

As you can see, each picture...underneath it...it has a little tiny shadow around the edges. 如您所见,每张图片...在其下方...在边缘周围都有一个微小的阴影。

How can this be done with a variable size image? 如何使用可变尺寸的图像完成此操作? (css) (CSS)

Beside the answers above, let me explain how devianart does it .. 除了上面的答案,让我解释一下devianart是如何做到的..

they have an image generator, that creates the shadow image at anysize they want .. 他们有一个图像生成器,可以生成所需大小的阴影图像。

You can see the background shadow of an image at http://sh.deviantart.net/shadow/x/113/150/logo3.png now playing around with the url and altering the 113 and 150 creates new images of arbitrary size which they use ... 您可以在http://sh.deviantart.net/shadow/x/113/150/logo3.png上看到图像的背景阴影,现在在播放URL并更改113和150可以创建任意大小的新图像他们使用 ...

您可以使用box-shadow ,但不能在跨浏览器中使用: http : //www.css3.info/preview/box-shadow/

You can do this by shifting a background image behind the original image. 您可以通过将背景图像移到原始图像后面来实现。 There are quite a few tutorials on the internet: Tutorial 1 Tutorial 2 互联网上有很多教程: 教程1 教程2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM