最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Remove image background with JavascriptjQuery - Stack Overflow

programmeradmin1浏览0评论

I came across this site and wanted to copy the way they have removed the background color from the product images. How do they do it? It seems they are doing it on the frontend, since all images are with white background color...

I came across this site http://skincity.se/sv/product/1198/md-formulations-vit-a-plus-hand-body-creme and wanted to copy the way they have removed the background color from the product images. How do they do it? It seems they are doing it on the frontend, since all images are with white background color...

Share Improve this question asked Oct 2, 2011 at 15:43 IamLasseIamLasse 1231 silver badge11 bronze badges 1
  • You mean the black header and footer that "float" above the images? If so it is probably done with just setting high zindex and absolute position in the CSS. – Gregory Mostizky Commented Oct 2, 2011 at 15:50
Add a ment  | 

2 Answers 2

Reset to default 2

They are placing a semi-transparent overlay overtop the image. See their CSS:

#primary-image-node-overlay {
    background-color: black;
    opacity: 0.08;
    filter: alpha(opacity = 8) !important;
}

I thought you were right about JavaScript, until I tried disabling it and refreshing the page - if you try that, you'll find that the effect remains.

It's actually some CSS trickery. The grayish background is actually above the image - it has a black background with an opacity of 0.08. It appears to be a gray background, when in fact it is a semi-transparent foreground.

Hope that helps!

发布评论

评论列表(0)

  1. 暂无评论