Inner shadow

이너 섀도우

Add the inset keyword to box-shadow and the shadow paints inside the border edge instead of outside — the surface reads as pressed in or recessed.

Also known as: inset box-shadowPressed shadowRecessed shadow
···
html
<div class="wrap"><div class="well" id="well"></div><div class="label" id="l">box-shadow: none</div></div>
css
body{background:#e4e8ef}
.wrap{position:relative;display:grid;place-items:center;gap:16px}
.well{width:min(70vmin,260px);height:56px;border-radius:14px;background:#e7e9f0;transition:box-shadow .5s}
.label{font:600 12px/1.4 monospace;color:#5b5b68}
js
const well = document.getElementById('well');
const l = document.getElementById('l');
const STATES = [
  ['none', 'box-shadow: none'],
  ['0 3px 8px rgba(0,0,0,.18)', 'box-shadow: 0 3px 8px …'],
  ['inset 0 2px 4px rgba(0,0,0,.25)', 'box-shadow: inset 0 2px 4px …'],
  ['inset 0 6px 14px rgba(0,0,0,.4), inset 0 1px 2px rgba(0,0,0,.5)', 'box-shadow: inset 0 6px 14px, inset 0 1px 2px'],
];
let i = 0;
function apply(){ const [css, label] = STATES[i]; well.style.boxShadow = css; l.textContent = label; i = (i + 1) % STATES.length; }
apply();
setInterval(apply, 1300);

A normal box-shadow spreads outward from the border edge, making the element look like it floats slightly above the surface. Add inset and it's the opposite: the shadow starts at the inner edge and reads as a surface pressed inward.

The meaning of direction flips too — the offset no longer says "where the light comes from," it says "which inner edge the shadow lands on." A positive y (assuming light from above) puts the shadow on the inner bottom edge, exactly how an overhead light would darken the far side of a recessed floor.

Layering multiple shadows still works the same way as outward ones — the first one declared paints on top, so put a tight, dark layer first and a wide, soft one after for a crisp inner edge plus a gentle wash. On an element with border-radius, the inset shadow follows the same rounded corners.

When to use

For pressed buttons/toggles, or a search field that reads as a recessed groove. Keep the contrast high enough — too subtle and it stops reading as clickable (neumorphism's classic problem).