Subtle shadows and smooth gradients give web interfaces depth, hierarchy, and polish without heavy background images. This visual generator lets you experiment with box-shadow parameters and two-stop linear-gradient() backgrounds in real time and copy production-ready CSS in one click.
box-shadow ValuesThe CSS box-shadow property accepts up to five values plus an optional inset keyword:
offset-x): Positive values push the shadow to the right; negative values push it to the left.offset-y): Positive values drop the shadow downward (simulating overhead light); negative values lift it upward.blur-radius): Controls how soft the shadow edge is. 0px produces a sharp hard-edged shadow; 20px–40px creates a soft ambient elevation.spread-radius): Expands (positive) or shrinks (negative) the shadow size before blurring. A negative spread (e.g. -4px) paired with a larger blur creates clean, modern card shadows that do not bleed excessively on the sides.rgba(0, 0, 0, 0.12) instead of solid hex keeps shadows natural over colored surfaces.linear-gradient()A CSS linear-gradient(angle, color1, color2) draws a smooth transition along a straight line defined by an angle in degrees: 0deg points straight up, 90deg points left-to-right, 135deg runs diagonally from top-left to bottom-right, and 180deg runs top-to-bottom. Because gradients are generated by the browser's rendering engine, they scale crisply on Retina/4K displays with zero HTTP requests.
0 1px 3px rgba(0,0,0,0.12)) for crisp contact and one soft shadow (0 10px 25px rgba(0,0,0,0.08)) for elevation.box-shadow affect layout? No. Shadows are painted outside the box model and do not shift neighboring elements or trigger layout reflows.-webkit- prefixes? Modern browsers (Chrome, Firefox, Safari, Edge) have supported unprefixed box-shadow and linear-gradient() for over a decade, so clean unprefixed CSS is recommended.Animating box-shadow directly on hover can trigger expensive browser repaints on large cards. For 60fps hover transitions, render the elevated shadow on a ::after pseudo-element and animate its opacity from 0 to 1 instead. On dark backgrounds, soft black shadows become nearly invisible - pair them with a subtle 1px top border or light inset highlight (rgba(255,255,255,0.08)) to preserve card separation.