I suppose rgba() would work here. After all, browser support for both box-shadow and rgba() is roughly the same.

/* 50% black box shadow */
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.5);

div {
    width: 200px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    color: white;
    background-color: red;
    margin: 10px;
}

div.a {
  box-shadow: 10px 10px 10px #000;
}

div.b {
  box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.5);
}
<div class="a">100% black shadow</div>
<div class="b">50% black shadow</div>

Answer from BoltClock on Stack Overflow
🌐
Refine
refine.dev › home › blog › tutorials › css box shadow with 25 examples
CSS Box Shadow with 25 Examples | Refine
February 28, 2024 - The example below has two box shadow effects separated by commas. Both of them have positive y-offset and blur radius. Both shadow effects will have black color with opacity of 0.12.
🌐
Tailwind CSS
tailwindcss.com › docs › box-shadow
box-shadow - Effects - Tailwind CSS
By default colored shadows have an opacity of 100% but you can adjust this using the opacity modifier. Use ring or ring-<number> utilities like ring-2 and ring-4 to apply a solid box-shadow to an element:
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › CSS › Reference › Properties › box-shadow
box-shadow - CSS - MDN - Mozilla
January 12, 2026 - The box-shadow CSS property adds shadow effects around an element's frame. You can set multiple effects separated by commas. A box shadow is described by X and Y offsets relative to the element, blur and spread radius, and color.
🌐
Webflow Help Center
help.webflow.com › hc › en-us › articles › 33961320572179-Box-shadow
Box shadow – Webflow Help Center
October 1, 2024 - You can access text shadows by selecting a text element and going to Style panel > Effects > Box shadows.
🌐
CSS-Tricks
css-tricks.com › almanac › properties › b › box-shadow
box-shadow | CSS-Tricks
September 22, 2022 - The box-shadow property in CSS is for putting shadows on elements (sometimes referred to as "drop shadows", ala Photoshop/Figma).
🌐
W3Schools
w3schools.com › css › css3_shadows_box.asp
CSS Box Shadow
The blur parameter defines the blur radius of the shadow. The higher the number, the more blurred the shadow will be. A <div> element with a 5px blurred, lightblue box-shadow
Find elsewhere
🌐
Reddit
reddit.com › r/web_design › simple trick to make your box-shadows look much better
r/web_design on Reddit: Simple trick to make your box-shadows look much better
June 23, 2017 -

I used to hate my box-shadows, before I discovered the magic behind others. A lot of you probably know this from before, but I still feel like sharing.

Instead of using 1 box-shadow, you use 2. The second one with bigger blur and .8 opacity.

Use a soft black for the first one.

X-axis = 0. Y-axis = 5-10px. Blur low, like 10px

Same color on 2nd, but lowered opacity.

X-axis = 0. Y-axis = 10px more than previous. Blur 40-50px.

Code goes something like this:

box-shadow: 0 5px 10px rgba(154,160,185,.05), 0 15px 40px rgba(166,173,201,.2);

Result

🌐
Chakra UI
chakra-ui.com › docs › styling › style-props › effects
Effects | Chakra UI
<Box shadow="60px -16px var(--shadow-color)" shadowColor="red" /> Use the opacity prop to set the opacity of an element.
🌐
SpinKit
tobiasahlin.com › blog › how-to-animate-box-shadow
How to animate box-shadow with silky smooth performance | Tobias Ahlin
November 18, 2015 - There are very few CSS properties that can be animated without constantly triggering repaints for every frame, namely opacity and transform. We minimize the amount of repaints (and work that your browser has to do) by sticking to only changing these two properties during the animation. This is the critical difference between the two techniques, stripping out all of the other layout styles: /* The slow way */ .make-it-slow { box-shadow: 0 1px 2px rgba(0,0,0,0.15); transition: box-shadow 0.3s ease-in-out; } /* Transition to a bigger shadow on hover */ .make-it-slow:hover { box-shadow: 0 5px 15px
🌐
CodePen
codepen.io › robkom › pen › KdjpjN
Box-shadow opacity and scale
body { /* background-color: lightgrey; ... 1.2); } /* Fade in the pseudo-element with the bigger shadow */ .box:hover:after { opacity: 1; } !...
🌐
LogRocket
blog.logrocket.com › home › styling with the css box-shadow property
Styling with the CSS box-shadow property - LogRocket Blog
February 19, 2025 - Using colors that contrast well—like the blue box-shadow against a dark background in this demo—ensures the effect is visually striking. Increasing the opacity makes the glow even brighter.
🌐
Josh W. Comeau
joshwcomeau.com › css › designing-shadows
Designing Beautiful Shadows in CSS • Josh W. Comeau
To ensure consistency, each shadow should use the same ratio between these two numbers. As an element gets closer to the user, the offset should increase, the blur radius should increase, and the shadow's opacity should decrease.
🌐
SheCodes
shecodes.io › athena › 20488-how-to-code-box-shadow-in-css
[CSS] - How to code box-shadow in CSS - SheCodes Athena - | SheCodes
Learn how to use the 'box-shadow' property in CSS to add shadow effects to HTML elements. ... How do you change how a website is display on a desktop PC versus a mobile device since the screen size is different? Responsive Design media queries CSS mobile devices desktop devices ... i made a container for my text with a background opacity ...
🌐
HTML-CSS-JS
html-css-js.com › css › generator › box-shadow
Box Shadow CSS Generator and Style Gallery
Set the properties of your box shadow to get the CSS style. Use the sliders and the color picker to set the values and watch the live preview until you reach the desired effect. Select the right-down shift, spread, blur, opacity, color.
🌐
Css3
css3.info › preview › box-shadow
Box-shadow, one of CSS3’s best new features - CSS3 . Info
By default, shadows are drawn on the outside of elements. According to the specification; An outer box-shadow casts a shadow as if the border-box of the element were opaque.
🌐
Tailwind CSS
v3.tailwindcss.com › docs › box-shadow-color
Box Shadow Color - Tailwind CSS
Use the shadow-* utilities to change the color of an existing box shadow. By default colored shadows have an opacity of 100%, but you can adjust this using the opacity modifier.
🌐
CSS Generator
cssgenerator.org › box-shadow-css-generator.html
Box Shadow CSS Generator
A box-shadow CSS Generator tool to quickly generate box-shadow CSS declarations.
🌐
Windi CSS
windicss.org › utilities › effects › box-shadow
Box Shadow | Windi CSS
export default { theme: { boxShadow: { 'sm': '0 1px 2px 0 rgba(0, 0, 0, 0.05)', 'DEFAULT': '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)', // If a DEFAULT shadow is provided, it will be used for the non-suffixed shadow utility.
🌐
CSSmatic
cssmatic.com › box-shadow
Box Shadow CSS Generator | CSSmatic
Shadow Color · color · Background Color · color · Box Color · color · Opacity · Outline Inset · knob · Copy Text · CSSmatic is a non-profit project, made by developers for developers · Are you a web developer? Would you like to collaborate on CSSMatic?