box-shadow
suggest changeThe box-shadow property draws one or more shadows around an element:
.card {
box-shadow:
0 1px 2px rgb(0 0 0 / 10%),
0 8px 24px rgb(0 0 0 / 12%);
}
.field {
box-shadow: inset 0 1px 2px rgb(0 0 0 / 15%);
}
Each layer has the following general form:
inset? <offset-x> <offset-y> <blur-radius>? <spread-radius>? <color>?
- Offsets position the shadow.
- Blur must be nonnegative; a larger value softens the edge.
- Positive spread expands the shadow and negative spread contracts it.
insetdraws the shadow inside the border edge.- Comma-separated shadows are painted front to back.
box-shadow is supported without vendor prefixes. Shadows do not affect layout and may be suppressed in forced-colors mode, so they should not be the only indication of focus or state.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents