# (Squarespace) Add a black overlay on Product block on hover

**URL:** <https://community.elfsight.com/t/squarespace-add-a-black-overlay-on-product-block-on-hover/101206>\
**Category:** Platform Tips\
**Tags:** squarespace\
**Created:** [February 14, 2025, 3:53pm UTC](https://community.elfsight.com/t/squarespace-add-a-black-overlay-on-product-block-on-hover/101206 "2025-02-14T15:53:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tuanphan](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/tuanphan/32/3165_2.png) [@tuanphan](https://community.elfsight.com/u/tuanphan)\
**Post date:** [February 14, 2025, 3:53pm UTC](https://community.elfsight.com/t/squarespace-add-a-black-overlay-on-product-block-on-hover/101206/1 "2025-02-14T15:53:32Z")

</div>

To add a black overlay on Product block on hover, you can use this code to Custom CSS box.

If code doesn’t work, you can comment below, [message](https://community.elfsight.com/u/tuanphan/) or [email me](mailto:info@beaverhero.com).

```auto
div.product-block .image-container a:after {
    content: "";
    background-color: rgba(0,0,0,0.75);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
}
div.product-block:hover .image-container a:after {
    opacity: 1;
    transition: all 0.3s ease;
}

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/4/0/40ebb617b529232fd9c49d6dce93d43658062b45.jpeg)

Result

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/3/1/312b3aba4494790d90b5738f3e21e5a606ecd9b7.png)

To change overlay color, change this line.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/3X/1/5/15badfb8c21989b8c73603e0af57b2acae0fcaf2.jpeg)
