透明PNG作为背景图像
我有一个以透明 png 作为背景图像的元素 - 它就像一张宝丽来,照片位被剪掉,所以只显示框架。
以此为背景,然后我想要一个标准图像位于具有透明 png 背景的元素后面 - 以适合框架内。
我尝试过设置 z 索引和不透明度,但由于不透明度设置,我可以让图像通过其明显透明的方式显示。
有什么想法吗?
I have an element with a transparent png as its background image - it's like a polaroid with the photo bit cut out so just the frame is showing.
With this as the background I then want a standard image to sit behind the element that has the transparent png background - to fit inside the frame.
i've tried setting z-indexing and opacity and although I can get the image to show through its obviously transparent because of the opacity settings.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果 .yourPhoto 是背景图像,您可以这样做:
或者您可以使用内联图像并将两者定位为绝对:
If .yourPhoto is a background image, you could do this:
Or you could use inline images and position both absolute:
做 PNG 时有很多事情需要注意。
背景已关闭。
尝试这些步骤。您不必更改图像的不透明度,因为它会影响整个图像。当您使用 z 索引时,您还应该放入位置 css 元素
there is a fair few things to look out for when doing PNG.
background is off.
Try these steps. You should not have to change the opacity of your image as it will affect the whole image. When you use z-indexing you should also put in the position css element