|$ curl https://forge-ai.dev/api/markdown?path=docs/css/properties
$cat docs/complete-css-property-reference.md
updated Today·50 min read·published

Complete CSS Property Reference

CSSPropertiesReferenceAll Levels🎯Free Tools
Introduction

A complete CSS property encyclopedia matters because layout, cascade, and visual design are contracts between authors, browsers, and AI agents. Every property encodes a default, an inheritance rule, and a value space. Guessing from muscle memory leaves gaps; a systematic reference closes them.

For humans, this page is a field guide: pick the right property, know whether it inherits, and avoid fighting the cascade. For AI agents crawling ForgeLearn via ?format=md or Accept: text/markdown, it is a structured inventory of major CSS properties with values, defaults, inheritance, and notes — so generated stylesheets stay intentional rather than !important-patched soup.

Pair this encyclopedia with the How to Master CSS curriculum and deep topic pages linked throughout. Tables use five columns: Property, Values, Default, Inherited, Notes.

info

Prefer the lowest-specificity fix that expresses intent. If @layer or source order can win, do not escalate to IDs or !important.
How to Read Each Entry
ColumnMeaning
PropertyCSS property or related descriptor name.
ValuesCommon keywords, data types, or representative syntax.
DefaultInitial value when not specified (simplified).
InheritedWhether the computed value inherits to descendants.
NotesWhen to use it, gotchas, and related ForgeLearn topics.
📝

note

Defaults and inheritance follow CSS specs but are summarized for teaching. Always verify edge cases (e.g. some properties inherit only through certain display types) on complex pages.
Cascade & Inheritance

Control how values resolve when multiple rules compete, and which properties flow to children. See also Cascade, Inheritance, and Cascade Layers.

PropertyValuesDefaultInheritedNotes
allinitial | inherit | unset | revert | revert-layern/aResets all properties except direction/unicode-bidi (with caveats).
inheritkeyword on any propertyn/aForces inheritance of parent computed value.
initialkeyword on any propertyn/aSets property to its initial (spec) value.
unsetkeyword on any propertyn/ainherit if inherited property, else initial.
revertkeyword on any propertyn/aRolls back to user-agent / previous origin cascade.
revert-layerkeyword on any propertyn/aRolls back to previous cascade layer.
cascade-keywords.css
CSS
1:where(.prose) {
2 color: unset; /* inherit from parent if color inherits */
3}
4.modal {
5 all: initial; /* nuclear — usually prefer revert-layer */
6}
7.btn {
8 color: revert-layer; /* undo this layer only */
9}
Box Model & Sizing

Content, padding, border, margin, and sizing keywords. Prefer border-box globally. Deep dive: Box Model, Sizing, Spacing.

PropertyValuesDefaultInheritedNotes
box-sizingcontent-box | border-boxcontent-boxNoborder-box includes padding+border in width/height.
width / height<length-percentage> | auto | min-content | max-content | fit-content | stretchautoNoPrefer logical inline-size / block-size for i18n.
min-width / max-widthsame + none (max)auto / noneNoClamp flex/grid items; prevent overflow.
min-height / max-heightsame + none (max)auto / noneNoUseful for sticky footers and cards.
aspect-ratioauto | <ratio>autoNoReserve space for media to reduce CLS.
padding1–4 <length-percentage>0NoAlso padding-block / padding-inline shorthands.
margin1–4 <length-percentage> | auto0NoVertical margins collapse between blocks.
margin-trimnone | block | inline | …noneNoNewer: trim margins at container edges.
preview
Display & Layout (Flex / Grid)

Display types and key Flexbox/Grid properties. Deep dives: Flexbox, Grid, Subgrid, Display.

PropertyValuesDefaultInheritedNotes
displayblock | inline | flex | grid | none | contents | flow-root | …inline*No*element-dependent; sets outer/inner display.
flex-directionrow | row-reverse | column | column-reverserowNoDefines main axis.
flex-wrapnowrap | wrap | wrap-reversenowrapNoAllow multi-line flex containers.
justify-contentstart | end | center | space-between | space-around | space-evenly | …normalNoMain-axis distribution.
align-itemsstretch | start | end | center | baseline | …normalNoCross-axis alignment of items.
align-contentsame + space-*normalNoMulti-line cross-axis packing.
gap<length-percentage>{1,2}normalNoPreferred over margin hacks between siblings.
flexnone | auto | <grow> <shrink> <basis>0 1 autoNoShorthand for grow/shrink/basis.
grid-template-columnsnone | <track-list> | subgridnoneNofr, minmax, repeat(auto-fit/fill).
grid-template-rowsnone | <track-list> | subgridnoneNoSubgrid inherits parent tracks.
grid-template-areasnone | <string>+noneNoNamed areas for readable layouts.
grid-column / grid-row<line> / <line> | span nautoNoPlace items on lines.
place-items<align> <justify>?normalNoShorthand align-items + justify-items.
flex-grid-key.css
CSS
1.nav { display: flex; align-items: center; gap: 1rem; }
2.cards {
3 display: grid;
4 grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
5 gap: 1rem;
6}
7.child { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }
preview
Positioning

Position schemes and insets. Prefer logical inset properties. See Positioning and Z-Index.

PropertyValuesDefaultInheritedNotes
positionstatic | relative | absolute | fixed | stickystaticNosticky needs threshold inset.
top/right/bottom/left<length-percentage> | autoautoNoPrefer inset-* logical forms.
inset1–4 valuesautoNoPhysical shorthand for all sides.
inset-block / inset-inline1–2 valuesautoNoWriting-mode aware.
z-indexauto | <integer>autoNoOnly within a stacking context.
isolationauto | isolateautoNoCreates stacking context cleanly.
Typography

Font and type metrics. See Typography and Fonts.

PropertyValuesDefaultInheritedNotes
font-family<family-name> | <generic>UA dependentYesAlways provide fallbacks.
font-size<length-percentage> | absolute/relative keywordsmediumYesPrefer rem + clamp for fluid type.
font-weightnormal | bold | 100–900 | bolder | lighternormalYesVariable fonts accept any number in range.
font-stylenormal | italic | oblique <angle>?normalYesPrefer real italic faces when available.
line-heightnormal | <number> | <length-percentage>normalYesUnitless numbers scale with font-size.
fontshorthandsee longhandsYesOrder: style variant weight size/line-height family.
font-display@font-face descriptorauton/aswap/optional for performance.
font-variation-settingsnormal | "wght" n …normalYesLow-level variable font axes.
Text
PropertyValuesDefaultInheritedNotes
color<color>UA dependentYesCurrentColor keyword used by many props.
text-alignstart | end | left | right | center | justifystartYesPrefer start/end for RTL.
text-decorationshorthand line/style/color/thicknessnoneNounderline/over/line-through.
text-transformnone | capitalize | uppercase | lowercasenoneYesAccessibility: do not rely on case alone.
letter-spacingnormal | <length>normalYesSlight tracking for headings.
word-breaknormal | break-all | keep-all | break-wordnormalYesHandle long URLs carefully.
white-spacenormal | nowrap | pre | pre-wrap | pre-line | break-spacesnormalYespre preserves whitespace.
text-overflowclip | ellipsis | <string>clipNoNeeds overflow hidden + nowrap usually.
line-clampnone | <integer> (via -webkit-line-clamp)noneNoSee Overflow topic for patterns.
hyphensnone | manual | automanualYesNeeds lang attribute for quality.
Colors & Backgrounds

Modern color spaces and background layers. See Colors, Backgrounds, Gradients, color-mix().

PropertyValuesDefaultInheritedNotes
color<color>UAYesoklch/oklab preferred for perceptual uniformity.
opacity<number> 0–11NoAffects entire element including children.
background-color<color>transparentNoSeparate from background-image.
background-imagenone | <image>#noneNoGradients are images.
background-sizeauto | cover | contain | <length-percentage>{1,2}autoNocover may crop; contain may letterbox.
background-position<position>0% 0%NoLogical positions evolving.
background-repeatrepeat | no-repeat | space | round | …repeatNoCommonly no-repeat for heroes.
backgroundshorthandsee longhandsNoLayers comma-separated; color last.
color-schemenormal | light | dark | only …normalYesHints UA form controls.
modern-color.css
CSS
1.chip {
2 background: color-mix(in oklch, var(--brand) 70%, black);
3 color: oklch(95% 0.02 250);
4}
Borders, Outlines & Radius
PropertyValuesDefaultInheritedNotes
borderwidth style colormedium none currentColorNoShorthand; logical border-block/inline exist.
border-radius1–4 lengths / optional /0NoPercentages relative to box.
outlinewidth style colormedium invert/autoNoDoes not affect layout; use for focus.
outline-offset<length>0NoSeparate focus ring from edge.
box-shadownone | inset? offsets blur spread colornoneNoMultiple shadows comma-separated.

best practice

Do not remove outlines without a visible :focus-visible replacement.
Transforms
PropertyValuesDefaultInheritedNotes
transformnone | <transform-list>noneNoCompositor-friendly; prefer over top/left.
transform-origin<position>50% 50%NoPivot point.
transform-styleflat | preserve-3dflatNo3D nested contexts.
perspectivenone | <length>noneNoOn parent for 3D children.
backface-visibilityvisible | hiddenvisibleNoCard flip UIs.
translate / rotate / scaleindividual transform propsnoneNoIndependent; animate separately.
preview
Transitions & Animations
PropertyValuesDefaultInheritedNotes
transition-propertynone | all | <property>#allNoList discrete props you intend to animate.
transition-duration<time>#0sNoKeep UI motion under ~300ms usually.
transition-timing-functionease | linear | cubic-bezier() | steps()easeNoease-out for exits often feels better.
transition-delay<time>#0sNoStagger carefully for a11y.
animation-namenone | <keyframes>#noneNoMatches @keyframes.
animation-duration<time>#0sNoRequired for visible animation.
animation-iteration-countinfinite | <number>1NoLoaders use infinite.
animation-fill-modenone | forwards | backwards | bothnoneNoforwards keeps end state.
animation-timelineauto | scroll() | view() | <timeline>autoNoScroll-driven animations.

warning

Always provide prefers-reduced-motion fallbacks for non-essential animation.
Filters & Effects
PropertyValuesDefaultInheritedNotes
filternone | blur() brightness() …noneNoCan create containing/stacking effects.
backdrop-filternone | <filter-function>#noneNoFrosted glass; needs semi-transparent bg.
mix-blend-modenormal | multiply | screen | …normalNoBlends with backdrop.
isolationauto | isolateautoNoLimit blend groups.
clip-pathnone | <clip-source> | <geometry>noneNopolygon/circle/path.
mask-imagenone | <image>#noneNoAlpha or luminance masks.
Scroll
PropertyValuesDefaultInheritedNotes
overflowvisible | hidden | clip | scroll | autovisibleNoAlso overflow-x/y / -inline/block.
overflow-wrapnormal | break-word | anywherenormalYesFormerly word-wrap.
overscroll-behaviorauto | contain | noneautoNoPrevent scroll chaining.
scroll-snap-typenone | x/y/both mandatory/proximitynoneNoCarousel patterns.
scroll-snap-alignnone | start | end | centernoneNoOn snap children.
scroll-margin<length>{1,4}0NoOffset for sticky headers + scrollIntoView.
scrollbar-gutterauto | stable | stable both-edgesautoNoReserve gutter to avoid layout shift.
scrollbar-widthauto | thin | noneautoNoLimited styling; respect a11y.
scroll-timeline / view-timelinetimeline namesnoneNoDrive animation-timeline.
UI (Cursor, Resize, Appearance)
PropertyValuesDefaultInheritedNotes
cursorauto | pointer | not-allowed | grab | …autoYespointer for buttons/links affordance.
resizenone | both | horizontal | verticalnoneNoNeeds overflow not visible.
appearancenone | auto | …autoNoReset native controls carefully.
caret-colorauto | <color>autoYesInput caret.
accent-colorauto | <color>autoYesCheckboxes/radios/range.
pointer-eventsauto | noneautoYesnone disables hit-testing.
user-selectauto | none | text | allautoNoAvoid disabling selection globally.
touch-actionauto | none | pan-x | pan-y | manipulation | …autoYesGesture control.
Logical Properties Map

Physical → logical mapping for LTR horizontal-tb writing mode (default). In RTL, inline-start becomes the right side. Full guide: Logical Properties.

PhysicalLogicalDefaultInheritedNotes
widthinline-sizeautoNoHorizontal measure in horizontal-tb.
heightblock-sizeautoNoVertical measure in horizontal-tb.
margin-left / rightmargin-inline-start / end0NoFlips in RTL.
margin-top / bottommargin-block-start / end0NoFollows block flow.
padding-left / rightpadding-inline-start / end0NoSame pattern for borders.
top / bottominset-block-start / endautoNoPositioning insets.
left / rightinset-inline-start / endautoNoPrefer over left/right.
border-*-leftborder-*-inline-startmediumNoBorder longhands exist per side.
text-align: lefttext-align: startstartYesstart/end are flow-relative.
logical.css
CSS
1.media {
2 margin-inline-start: 1rem;
3 padding-block: 0.5rem 1rem;
4 border-inline-start: 3px solid var(--brand);
5 inset-inline-end: 0;
6}
Media & Container Query Features
FeatureValuesDefaultInheritedNotes
width / min-width / max-width<length>n/a@media viewport size.
prefers-color-schemelight | darkn/aSystem theme preference.
prefers-reduced-motionno-preference | reducen/aMandatory for motion a11y.
prefers-contrastno-preference | more | lessn/aIncrease contrast when more.
forced-colorsnone | activen/aWindows High Contrast etc.
hover / pointerhover/none · fine/coarsen/aInput capability queries.
container-typenormal | size | inline-sizenormalNoEstablishes query container.
@containername? (condition)n/aStyle by container size.
cqw / cqi / …container query unitsn/a1% of container dimension.
Modern: @layer, @property, View Timelines

Architectural and Houdini-adjacent features. See Cascade Layers, @property, Scroll Animations, View Transitions, @scope.

FeatureValuesDefaultInheritedNotes
@layername order | blockn/aLater layers beat earlier regardless of specificity.
@propertysyntax / inherits / initial-valuen/aTyped custom props; animatable.
@scope(root) to (limit)n/aProximity-based style isolation.
view-transition-namenone | <custom-ident>noneNoNamed VT elements must be unique.
view-timeline-namenone | <dashed-ident>noneNoProgress as element enters view.
animation-rangenormal | <length-percentage>normalNoTrim scroll-driven ranges.
anchor-name / position-anchornone | <dashed-ident>noneNoAnchor positioning API.
modern-at-rules.css
CSS
1@layer reset, tokens, components, utilities;
2
3@property --hue {
4 syntax: "<number>";
5 inherits: true;
6 initial-value: 210;
7}
8
9@scope (.card) {
10 :scope { padding: 1rem; }
11 title { font-weight: 600; }
12}
13
14.hero { view-transition-name: hero; }
🔥

pro tip

Unlayered styles beat all layers. Keep app overrides unlayered or in the highest intentional layer — document the strategy.

Community

Get help on Slack, Discord or VIP

Stuck on a guide? Join the community and ask.