Shadow for a transparent rect

Hi, I want to make a transparent rounded rectangle with a shadow. The closest thing I got is 1% opacity, if I set it to 0% the shadow is lost. Here’s the generated CSS:

position: absolute;
width: 21px;
height: 20px;

background: rgba(255, 255, 255, 0.01);
box-shadow: 0px 6px 12px -2px rgba(0, 0, 0, 0.4);
border-radius: 6px;

How do I achieve this ? Thanks !

For the purposes of generating CSS, try using 0.003 for opacity. That should zero out the value shown in code.

1 Like

No it’s not for CSS, I want to export it as a png file.

The 0.003 color opacity trick (on the fill of the thing you want to add the drop shadow to) should work on an export to png. It will be a transparent background once exported.

Oh, that did work, Thanks a lot !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.