Button pressed state
- Input
- :active pseudo-class em botão
- Expected output
- box-shadow: inset 0 2px 4px rgba(0,0,0,.2), inset 0 1px 2px rgba(0,0,0,.15);
Pairs with `transform: translateY(1px)` for a complete press effect.
CSS inset shadow depth effect
The `inset` keyword in box-shadow reverses the shadow direction: instead of projecting outward, it appears inside the element. This is used to create pressed states on buttons, sunken input fields, neumorphism effects and any situation where the goal is to make the element appear below the screen surface.
Pairs with `transform: translateY(1px)` for a complete press effect.
Inner for depth + outer for accessibility focus ring.
Yes. CSS allows as many layers as needed, separated by commas. Each layer has its own offset, blur, spread and color parameters, enabling much richer effects than a single shadow.
Yes. CSS applies both to the same element without issue. It is common to have an inset for inner depth and an outer for a focus ring or elevation simultaneously.
Neumorphism has serious accessibility issues because the low contrast between elements makes it difficult for users with low vision to identify interactive elements. Prefer applying it only to secondary or decorative elements.
box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.25);CSS is generated locally in your browser.