CSS Properties

Beginner
15 min read
Updated: Nov 2026
5 examples
569 property guides

Definition and Usage

CSS properties are the style settings inside a rule. Each one controls one aspect of how an element looks or lays out—text color, spacing, size, flex alignment, animation, and more.

Property vs value

A property is the name (color, margin). A value is what you assign (#334155, 1rem). Together they form a declaration: property: value;.

What should beginners learn first?

Master color, font-size, font-family, margin, padding, border, width, height, and display first. Those cover typography, the box model, and basic layout before you dive into Flexbox or Grid.

Hub vs single-property pages

This page teaches how properties work in a CSS tutorial. Each name in the index links to a focused guide (for example CSS color Property). For targeting elements before you style them, see CSS Selectors; for responsive rules, see Media Queries.

One rule pattern.

Every stylesheet follows selector { property: value; }. Change one property at a time when you are learning so you can see the effect clearly.

Semicolons matter.

End each declaration with ;. A missing semicolon can cause the next property to be ignored.

Selectors come first.

Properties only apply to elements your selector matches. Learn both sides of the rule.

CSS Syntax

A rule pairs a selector with one or more property declarations:

CSS
p {
  color: #334155;
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* shorthand sets several longhands */
.card {
  margin: 1rem;
  padding: 1.25rem;
}

Core CSS Concepts

How properties are grouped when you style real pages:

CategoryExample propertiesPurpose
Text & typographycolor, font-size, font-familyHow text looks and reads
Box modelmargin, padding, borderSpacing around content
Layoutdisplay, width, positionHow elements are placed
Backgroundbackground-color, background-imageFill behind content
Flexbox & Gridflex, gap, grid-template-columnsModern layout systems

The CSS box model

Every element is a box. Properties control each layer:

  • Content — The text or image inside (width, height).
  • Padding — Space inside the border (padding).
  • Border — Line around padding (border).
  • Margin — Space outside the border (margin).

Prefer box-sizing border-box so width includes padding and border—sizing becomes predictable.

Shorthand vs longhand

KindExampleNotes
Shorthandmargin: 1rem;Sets all four sides at once
Longhandmargin-top: 1rem;One side only
Shorthandborder: 1px solid #e2e8f0;Width, style, and color together
Longhandborder-radius: 0.5rem;Corners only (related, not a border shorthand)

Starter properties by job

JobProperties
Readable textcolor, font-size, line-height
Spacingmargin, padding, gap
Surfacesbackground-color, border, border-radius
Layout modedisplay (block, flex, grid)
Sizingwidth, max-width, height

How to Use CSS Properties

A practical workflow for this tutorial track:

  1. Write valid HTML first so you have elements to style.
  2. Choose a selector that targets those elements (selectors hub).
  3. Add declarations for the job: text, spacing, layout, then polish.
  4. Prefer shorthand (margin, padding, border) until you need one side.
  5. Use DevTools to inspect which properties actually apply.
  6. Open a single-property page from the index when you need values, examples, and FAQs.

Live Preview

Toggle extra padding on the sample box—same idea as writing padding: 1.75rem 2rem; in CSS.

Watch how padding changes space inside the border without moving the border itself.

Preview
color · padding · background · border · border-radius

CSS Examples

Five starter patterns from a CSS tutorial: text, box model, sizing, background, and flex. Open each property’s guide for live try-it editors.

Example 1 — Text styling

Set text color and size with color and font-size.

CSS
p {
  color: #334155;
  font-size: 1.125rem;
  font-family: system-ui, sans-serif;
}
color Tutorial

How It Works

  1. color sets the text fill.
  2. font-size controls how large the type is.
  3. font-family chooses the typeface stack.
  4. rem scales with the root font size—friendlier for accessibility.

Example 2 — Box model spacing

Use margin and padding for outer and inner spacing.

CSS
.card {
  margin: 1rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
}
margin Tutorial

How It Works

  1. margin pushes other elements away (outside the border).
  2. padding adds space inside the border before the content.
  3. border draws the edge between padding and margin.
  4. Shorthand values apply to all sides unless you use longhands.

Example 3 — Width and display

Control element size and layout mode.

CSS
.box {
  width: 200px;
  height: 80px;
  display: block;
}
width Tutorial

How It Works

  1. width and height set the content box size.
  2. display: block makes the element start on its own line.
  3. Later switch to display: flex or grid for modern layouts.
  4. max-width often works better than fixed width for responsive pages.

Example 4 — Background and border

Fill the area behind content and add a visible edge.

CSS
.panel {
  background-color: #eff6ff;
  border: 2px solid #2563eb;
  border-radius: 0.5rem;
}

How It Works

  1. background-color fills the box behind content.
  2. border sets width, style, and color in one declaration.
  3. border-radius rounds the corners.
  4. Contrast text color against the background for readability.

Example 5 — Flexbox layout

Align items in a row with display: flex and align-items.

CSS
.row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
display Tutorial

How It Works

  1. display: flex turns the element into a flex container.
  2. gap spaces flex items without margin hacks.
  3. align-items: center centers items on the cross axis.
  4. Next explore flex, justify-content, and align-content.

CSS Property Tutorial Index

Search by property name or browse by category. Every row links to a full guide with syntax, try-it examples, and FAQs (569 tutorials).

Getting Started

10 tutorials

Essential properties every beginner should learn first.

PropertyDescriptionTutorial
colorTutorial for the CSS color property.Try it
background-colorTutorial for the CSS background color property.Try it
font-familyTutorial for the CSS font family property.Try it
font-sizeTutorial for the CSS font size property.Try it
marginTutorial for the CSS margin property.Try it
paddingTutorial for the CSS padding property.Try it
borderTutorial for the CSS border property.Try it
widthTutorial for the CSS width property.Try it
heightTutorial for the CSS height property.Try it
displayTutorial for the CSS display property.Try it

Typography & Text

75 tutorials

Fonts, text styling, spacing, and wrapping.

PropertyDescriptionTutorial
directionTutorial for the CSS direction property.Try it
fontTutorial for the CSS font property.Try it
font-feature-settingsTutorial for the CSS font feature settings property.Try it
font-kerningTutorial for the CSS font kerning property.Try it
font-language-overrideTutorial for the CSS font language override property.Try it
font-optical-sizingTutorial for the CSS font optical sizing property.Try it
font-paletteTutorial for the CSS font palette property.Try it
font-size-adjustTutorial for the CSS font size adjust property.Try it
font-smoothTutorial for the CSS font smooth property.Try it
font-stretchTutorial for the CSS font stretch property.Try it
font-styleTutorial for the CSS font style property.Try it
font-synthesisTutorial for the CSS font synthesis property.Try it
font-synthesis-positionTutorial for the CSS font synthesis position property.Try it
font-synthesis-small-capsTutorial for the CSS font synthesis small caps property.Try it
font-synthesis-styleTutorial for the CSS font synthesis style property.Try it
font-synthesis-weightTutorial for the CSS font synthesis weight property.Try it
font-variantTutorial for the CSS font variant property.Try it
font-variant-alternatesTutorial for the CSS font variant alternates property.Try it
font-variant-capsTutorial for the CSS font variant caps property.Try it
font-variant-east-asianTutorial for the CSS font variant east asian property.Try it
font-variant-emojiTutorial for the CSS font variant emoji property.Try it
font-variant-ligaturesTutorial for the CSS font variant ligatures property.Try it
font-variant-numericTutorial for the CSS font variant numeric property.Try it
font-variant-positionTutorial for the CSS font variant position property.Try it
font-variation-settingsTutorial for the CSS font variation settings property.Try it
font-weightTutorial for the CSS font weight property.Try it
font-widthTutorial for the CSS font width property.Try it
hyphensTutorial for the CSS hyphens property.Try it
letter-spacingTutorial for the CSS letter spacing property.Try it
line-heightTutorial for the CSS line height property.Try it
line-height-stepTutorial for the CSS line height step property.Try it
tab-sizeTutorial for the CSS tab size property.Try it
text-alignTutorial for the CSS text align property.Try it
text-align-lastTutorial for the CSS text align last property.Try it
text-anchorTutorial for the CSS text anchor property.Try it
text-autospaceTutorial for the CSS text autospace property.Try it
text-autospace-sizeTutorial for the CSS text autospace size property.Try it
text-boxTutorial for the CSS text box property.Try it
text-box-edgeTutorial for the CSS text box edge property.Try it
text-box-trimTutorial for the CSS text box trim property.Try it
text-combine-uprightTutorial for the CSS text combine upright property.Try it
text-decorationTutorial for the CSS text decoration property.Try it
text-decoration-colorTutorial for the CSS text decoration color property.Try it
text-decoration-insetTutorial for the CSS text decoration inset property.Try it
text-decoration-lineTutorial for the CSS text decoration line property.Try it
text-decoration-skipTutorial for the CSS text decoration skip property.Try it
text-decoration-skip-inkTutorial for the CSS text decoration skip ink property.Try it
text-decoration-styleTutorial for the CSS text decoration style property.Try it
text-decoration-thicknessTutorial for the CSS text decoration thickness property.Try it
text-emphasisTutorial for the CSS text emphasis property.Try it
text-emphasis-colorTutorial for the CSS text emphasis color property.Try it
text-emphasis-positionTutorial for the CSS text emphasis position property.Try it
text-emphasis-styleTutorial for the CSS text emphasis style property.Try it
text-fitTutorial for the CSS text fit property.Try it
text-indentTutorial for the CSS text indent property.Try it
text-justifyTutorial for the CSS text justify property.Try it
text-orientationTutorial for the CSS text orientation property.Try it
text-overflowTutorial for the CSS text overflow property.Try it
text-renderingTutorial for the CSS text rendering property.Try it
text-shadowTutorial for the CSS text shadow property.Try it
text-size-adjustTutorial for the CSS text size adjust property.Try it
text-spacing-trimTutorial for the CSS text spacing trim property.Try it
text-transformTutorial for the CSS text transform property.Try it
text-underline-offsetTutorial for the CSS text underline offset property.Try it
text-underline-positionTutorial for the CSS text underline position property.Try it
text-wrapTutorial for the CSS text wrap property.Try it
text-wrap-modeTutorial for the CSS text wrap mode property.Try it
text-wrap-styleTutorial for the CSS text wrap style property.Try it
unicode-bidiTutorial for the CSS unicode bidi property.Try it
white-spaceTutorial for the CSS white space property.Try it
white-space-collapseTutorial for the CSS white space collapse property.Try it
word-breakTutorial for the CSS word break property.Try it
word-spacingTutorial for the CSS word spacing property.Try it
word-wrapTutorial for the CSS word wrap property.Try it
writing-modeTutorial for the CSS writing mode property.Try it

Box Model & Sizing

94 tutorials

Margins, padding, borders, and dimensions.

PropertyDescriptionTutorial
aspect-ratioTutorial for the CSS aspect ratio property.Try it
block-sizeTutorial for the CSS block size property.Try it
border-blockTutorial for the CSS border block property.Try it
border-block-colorTutorial for the CSS border block color property.Try it
border-block-endTutorial for the CSS border block end property.Try it
border-block-end-colorTutorial for the CSS border block end color property.Try it
border-block-end-styleTutorial for the CSS border block end style property.Try it
border-block-end-widthTutorial for the CSS border block end width property.Try it
border-block-startTutorial for the CSS border block start property.Try it
border-block-start-colorTutorial for the CSS border block start color property.Try it
border-block-start-styleTutorial for the CSS border block start style property.Try it
border-block-start-widthTutorial for the CSS border block start width property.Try it
border-block-styleTutorial for the CSS border block style property.Try it
border-block-widthTutorial for the CSS border block width property.Try it
border-bottomTutorial for the CSS border bottom property.Try it
border-bottom-colorTutorial for the CSS border bottom color property.Try it
border-bottom-left-radiusTutorial for the CSS border bottom left radius property.Try it
border-bottom-right-radiusTutorial for the CSS border bottom right radius property.Try it
border-bottom-styleTutorial for the CSS border bottom style property.Try it
border-bottom-widthTutorial for the CSS border bottom width property.Try it
border-collapseTutorial for the CSS border collapse property.Try it
border-colorTutorial for the CSS border color property.Try it
border-end-end-radiusTutorial for the CSS border end end radius property.Try it
border-end-start-radiusTutorial for the CSS border end start radius property.Try it
border-imageTutorial for the CSS border image property.Try it
border-image-outsetTutorial for the CSS border image outset property.Try it
border-image-repeatTutorial for the CSS border image repeat property.Try it
border-image-sliceTutorial for the CSS border image slice property.Try it
border-image-sourceTutorial for the CSS border image source property.Try it
border-image-widthTutorial for the CSS border image width property.Try it
border-inlineTutorial for the CSS border inline property.Try it
border-inline-colorTutorial for the CSS border inline color property.Try it
border-inline-endTutorial for the CSS border inline end property.Try it
border-inline-end-colorTutorial for the CSS border inline end color property.Try it
border-inline-end-styleTutorial for the CSS border inline end style property.Try it
border-inline-end-widthTutorial for the CSS border inline end width property.Try it
border-inline-startTutorial for the CSS border inline start property.Try it
border-inline-start-colorTutorial for the CSS border inline start color property.Try it
border-inline-start-styleTutorial for the CSS border inline start style property.Try it
border-inline-start-widthTutorial for the CSS border inline start width property.Try it
border-inline-styleTutorial for the CSS border inline style property.Try it
border-inline-widthTutorial for the CSS border inline width property.Try it
border-leftTutorial for the CSS border left property.Try it
border-left-colorTutorial for the CSS border left color property.Try it
border-left-styleTutorial for the CSS border left style property.Try it
border-left-widthTutorial for the CSS border left width property.Try it
border-radiusTutorial for the CSS border radius property.Try it
border-rightTutorial for the CSS border right property.Try it
border-right-colorTutorial for the CSS border right color property.Try it
border-right-styleTutorial for the CSS border right style property.Try it
border-right-widthTutorial for the CSS border right width property.Try it
border-shapeTutorial for the CSS border shape property.Try it
border-spacingTutorial for the CSS border spacing property.Try it
border-start-end-radiusTutorial for the CSS border start end radius property.Try it
border-start-start-radiusTutorial for the CSS border start start radius property.Try it
border-styleTutorial for the CSS border style property.Try it
border-topTutorial for the CSS border top property.Try it
border-top-colorTutorial for the CSS border top color property.Try it
border-top-left-radiusTutorial for the CSS border top left radius property.Try it
border-top-right-radiusTutorial for the CSS border top right radius property.Try it
border-top-styleTutorial for the CSS border top style property.Try it
border-top-widthTutorial for the CSS border top width property.Try it
border-widthTutorial for the CSS border width property.Try it
box-sizingTutorial for the CSS box sizing property.Try it
inline-sizeTutorial for the CSS inline size property.Try it
margin-blockTutorial for the CSS margin block property.Try it
margin-block-endTutorial for the CSS margin block end property.Try it
margin-block-startTutorial for the CSS margin block start property.Try it
margin-bottomTutorial for the CSS margin bottom property.Try it
margin-inlineTutorial for the CSS margin inline property.Try it
margin-inline-endTutorial for the CSS margin inline end property.Try it
margin-inline-startTutorial for the CSS margin inline start property.Try it
margin-leftTutorial for the CSS margin left property.Try it
margin-rightTutorial for the CSS margin right property.Try it
margin-topTutorial for the CSS margin top property.Try it
margin-trimTutorial for the CSS margin trim property.Try it
max-block-sizeTutorial for the CSS max block size property.Try it
max-heightTutorial for the CSS max height property.Try it
max-inline-sizeTutorial for the CSS max inline size property.Try it
max-widthTutorial for the CSS max width property.Try it
min-block-sizeTutorial for the CSS min block size property.Try it
min-heightTutorial for the CSS min height property.Try it
min-inline-sizeTutorial for the CSS min inline size property.Try it
min-widthTutorial for the CSS min width property.Try it
padding-blockTutorial for the CSS padding block property.Try it
padding-block-endTutorial for the CSS padding block end property.Try it
padding-block-startTutorial for the CSS padding block start property.Try it
padding-bottomTutorial for the CSS padding bottom property.Try it
padding-inlineTutorial for the CSS padding inline property.Try it
padding-inline-endTutorial for the CSS padding inline end property.Try it
padding-inline-startTutorial for the CSS padding inline start property.Try it
padding-leftTutorial for the CSS padding left property.Try it
padding-rightTutorial for the CSS padding right property.Try it
padding-topTutorial for the CSS padding top property.Try it

Flexbox

16 tutorials

Flexible box layout alignment and sizing.

PropertyDescriptionTutorial
align-contentTutorial for the CSS align content property.Try it
align-itemsTutorial for the CSS align items property.Try it
align-selfTutorial for the CSS align self property.Try it
flexTutorial for the CSS flex property.Try it
flex-basisTutorial for the CSS flex basis property.Try it
flex-directionTutorial for the CSS flex direction property.Try it
flex-flowTutorial for the CSS flex flow property.Try it
flex-growTutorial for the CSS flex grow property.Try it
flex-line-countTutorial for the CSS flex line count property.Try it
flex-shrinkTutorial for the CSS flex shrink property.Try it
flex-wrapTutorial for the CSS flex wrap property.Try it
gapTutorial for the CSS gap property.Try it
justify-contentTutorial for the CSS justify content property.Try it
justify-itemsTutorial for the CSS justify items property.Try it
justify-selfTutorial for the CSS justify self property.Try it
orderTutorial for the CSS order property.Try it

Grid

18 tutorials

CSS Grid track and area properties.

PropertyDescriptionTutorial
gridTutorial for the CSS grid property.Try it
grid-areaTutorial for the CSS grid area property.Try it
grid-auto-columnsTutorial for the CSS grid auto columns property.Try it
grid-auto-flowTutorial for the CSS grid auto flow property.Try it
grid-auto-rowsTutorial for the CSS grid auto rows property.Try it
grid-columnTutorial for the CSS grid column property.Try it
grid-column-endTutorial for the CSS grid column end property.Try it
grid-column-gapTutorial for the CSS grid column gap property.Try it
grid-column-startTutorial for the CSS grid column start property.Try it
grid-gapTutorial for the CSS grid gap property.Try it
grid-rowTutorial for the CSS grid row property.Try it
grid-row-endTutorial for the CSS grid row end property.Try it
grid-row-gapTutorial for the CSS grid row gap property.Try it
grid-row-startTutorial for the CSS grid row start property.Try it
grid-templateTutorial for the CSS grid template property.Try it
grid-template-areasTutorial for the CSS grid template areas property.Try it
grid-template-columnsTutorial for the CSS grid template columns property.Try it
grid-template-rowsTutorial for the CSS grid template rows property.Try it

Background & Color

24 tutorials

Colors, backgrounds, and blending.

PropertyDescriptionTutorial
accent-colorTutorial for the CSS accent color property.Try it
backgroundTutorial for the CSS background property.Try it
background-attachmentTutorial for the CSS background attachment property.Try it
background-blend-modeTutorial for the CSS background blend mode property.Try it
background-clipTutorial for the CSS background clip property.Try it
background-imageTutorial for the CSS background image property.Try it
background-originTutorial for the CSS background origin property.Try it
background-positionTutorial for the CSS background position property.Try it
background-position-xTutorial for the CSS background position x property.Try it
background-position-yTutorial for the CSS background position y property.Try it
background-repeatTutorial for the CSS background repeat property.Try it
background-repeat-xTutorial for the CSS background repeat x property.Try it
background-repeat-yTutorial for the CSS background repeat y property.Try it
background-sizeTutorial for the CSS background size property.Try it
caretTutorial for the CSS caret property.Try it
caret-animationTutorial for the CSS caret animation property.Try it
caret-colorTutorial for the CSS caret color property.Try it
caret-shapeTutorial for the CSS caret shape property.Try it
color-interpolationTutorial for the CSS color interpolation property.Try it
color-interpolation-filtersTutorial for the CSS color interpolation filters property.Try it
color-schemeTutorial for the CSS color scheme property.Try it
isolationTutorial for the CSS isolation property.Try it
mix-blend-modeTutorial for the CSS mix blend mode property.Try it
opacityTutorial for the CSS opacity property.Try it

Animation & Motion

24 tutorials

Transitions, animations, and transforms.

PropertyDescriptionTutorial
animationTutorial for the CSS animation property.Try it
animation-compositionTutorial for the CSS animation composition property.Try it
animation-delayTutorial for the CSS animation delay property.Try it
animation-directionTutorial for the CSS animation direction property.Try it
animation-durationTutorial for the CSS animation duration property.Try it
animation-fill-modeTutorial for the CSS animation fill mode property.Try it
animation-iteration-countTutorial for the CSS animation iteration count property.Try it
animation-nameTutorial for the CSS animation name property.Try it
animation-play-stateTutorial for the CSS animation play state property.Try it
animation-rangeTutorial for the CSS animation range property.Try it
animation-range-endTutorial for the CSS animation range end property.Try it
animation-range-startTutorial for the CSS animation range start property.Try it
animation-timelineTutorial for the CSS animation timeline property.Try it
animation-timing-functionTutorial for the CSS animation timing function property.Try it
transformTutorial for the CSS transform property.Try it
transform-boxTutorial for the CSS transform box property.Try it
transform-originTutorial for the CSS transform origin property.Try it
transform-styleTutorial for the CSS transform style property.Try it
transitionTutorial for the CSS transition property.Try it
transition-behaviorTutorial for the CSS transition behavior property.Try it
transition-delayTutorial for the CSS transition delay property.Try it
transition-durationTutorial for the CSS transition duration property.Try it
transition-propertyTutorial for the CSS transition property property.Try it
transition-timing-functionTutorial for the CSS transition timing function property.Try it

Layout & Position

44 tutorials

Positioning, overflow, and visibility.

PropertyDescriptionTutorial
bottomTutorial for the CSS bottom property.Try it
clearTutorial for the CSS clear property.Try it
clipTutorial for the CSS clip property.Try it
clip-pathTutorial for the CSS clip path property.Try it
clip-ruleTutorial for the CSS clip rule property.Try it
containTutorial for the CSS contain property.Try it
contain-intrinsic-block-sizeTutorial for the CSS contain intrinsic block size property.Try it
contain-intrinsic-heightTutorial for the CSS contain intrinsic height property.Try it
contain-intrinsic-inline-sizeTutorial for the CSS contain intrinsic inline size property.Try it
contain-intrinsic-sizeTutorial for the CSS contain intrinsic size property.Try it
contain-intrinsic-widthTutorial for the CSS contain intrinsic width property.Try it
containerTutorial for the CSS container property.Try it
container-nameTutorial for the CSS container name property.Try it
container-typeTutorial for the CSS container type property.Try it
contentTutorial for the CSS content property.Try it
content-visibilityTutorial for the CSS content visibility property.Try it
floatTutorial for the CSS float property.Try it
insetTutorial for the CSS inset property.Try it
inset-blockTutorial for the CSS inset block property.Try it
inset-block-endTutorial for the CSS inset block end property.Try it
inset-block-startTutorial for the CSS inset block start property.Try it
inset-inlineTutorial for the CSS inset inline property.Try it
inset-inline-endTutorial for the CSS inset inline end property.Try it
inset-inline-startTutorial for the CSS inset inline start property.Try it
leftTutorial for the CSS left property.Try it
overflowTutorial for the CSS overflow property.Try it
overflow-anchorTutorial for the CSS overflow anchor property.Try it
overflow-blockTutorial for the CSS overflow block property.Try it
overflow-clip-marginTutorial for the CSS overflow clip margin property.Try it
overflow-inlineTutorial for the CSS overflow inline property.Try it
overflow-wrapTutorial for the CSS overflow wrap property.Try it
overflow-xTutorial for the CSS overflow x property.Try it
overflow-yTutorial for the CSS overflow y property.Try it
positionTutorial for the CSS position property.Try it
position-anchorTutorial for the CSS position anchor property.Try it
position-areaTutorial for the CSS position area property.Try it
position-tryTutorial for the CSS position try property.Try it
position-try-fallbacksTutorial for the CSS position try fallbacks property.Try it
position-try-orderTutorial for the CSS position try order property.Try it
position-visibilityTutorial for the CSS position visibility property.Try it
rightTutorial for the CSS right property.Try it
topTutorial for the CSS top property.Try it
visibilityTutorial for the CSS visibility property.Try it
z-indexTutorial for the CSS z index property.Try it

Effects & Filters

8 tutorials

Shadows, outlines, and visual filters.

PropertyDescriptionTutorial
backdrop-filterTutorial for the CSS backdrop filter property.Try it
box-shadowTutorial for the CSS box shadow property.Try it
filterTutorial for the CSS filter property.Try it
outlineTutorial for the CSS outline property.Try it
outline-colorTutorial for the CSS outline color property.Try it
outline-offsetTutorial for the CSS outline offset property.Try it
outline-styleTutorial for the CSS outline style property.Try it
outline-widthTutorial for the CSS outline width property.Try it

Lists & Tables

7 tutorials

List markers and table presentation.

PropertyDescriptionTutorial
caption-sideTutorial for the CSS caption side property.Try it
empty-cellsTutorial for the CSS empty cells property.Try it
list-styleTutorial for the CSS list style property.Try it
list-style-imageTutorial for the CSS list style image property.Try it
list-style-positionTutorial for the CSS list style position property.Try it
list-style-typeTutorial for the CSS list style type property.Try it
table-layoutTutorial for the CSS table layout property.Try it

More Properties

249 tutorials

Additional CSS properties — search or browse alphabetically.

PropertyDescriptionTutorial
alignment-baselineTutorial for the CSS alignment baseline property.Try it
allTutorial for the CSS all property.Try it
anchor-nameTutorial for the CSS anchor name property.Try it
anchor-scopeTutorial for the CSS anchor scope property.Try it
appearanceTutorial for the CSS appearance property.Try it
backface-visibilityTutorial for the CSS backface visibility property.Try it
baseline-shiftTutorial for the CSS baseline shift property.Try it
baseline-sourceTutorial for the CSS baseline source property.Try it
box-alignTutorial for the CSS box align property.Try it
box-decoration-breakTutorial for the CSS box decoration break property.Try it
box-directionTutorial for the CSS box direction property.Try it
box-flexTutorial for the CSS box flex property.Try it
box-flex-groupTutorial for the CSS box flex group property.Try it
box-linesTutorial for the CSS box lines property.Try it
box-ordinal-groupTutorial for the CSS box ordinal group property.Try it
box-orientTutorial for the CSS box orient property.Try it
box-packTutorial for the CSS box pack property.Try it
box-reflectTutorial for the CSS box reflect property.Try it
break-afterTutorial for the CSS break after property.Try it
break-beforeTutorial for the CSS break before property.Try it
break-insideTutorial for the CSS break inside property.Try it
column-countTutorial for the CSS column count property.Try it
column-fillTutorial for the CSS column fill property.Try it
column-gapTutorial for the CSS column gap property.Try it
column-heightTutorial for the CSS column height property.Try it
column-ruleTutorial for the CSS column rule property.Try it
column-rule-breakTutorial for the CSS column rule break property.Try it
column-rule-colorTutorial for the CSS column rule color property.Try it
column-rule-inset-capTutorial for the CSS column rule inset cap property.Try it
column-rule-inset-cap-endTutorial for the CSS column rule inset cap end property.Try it
column-rule-inset-cap-startTutorial for the CSS column rule inset cap start property.Try it
column-rule-inset-junctionTutorial for the CSS column rule inset junction property.Try it
column-rule-inset-junction-endTutorial for the CSS column rule inset junction end property.Try it
column-rule-inset-junction-startTutorial for the CSS column rule inset junction start property.Try it
column-rule-styleTutorial for the CSS column rule style property.Try it
column-rule-visibility-itemsTutorial for the CSS column rule visibility items property.Try it
column-rule-widthTutorial for the CSS column rule width property.Try it
column-spanTutorial for the CSS column span property.Try it
column-widthTutorial for the CSS column width property.Try it
column-wrapTutorial for the CSS column wrap property.Try it
columnsTutorial for the CSS columns property.Try it
corner-block-end-shapeTutorial for the CSS corner block end shape property.Try it
corner-block-start-shapeTutorial for the CSS corner block start shape property.Try it
corner-bottom-left-shapeTutorial for the CSS corner bottom left shape property.Try it
corner-bottom-right-shapeTutorial for the CSS corner bottom right shape property.Try it
corner-bottom-shapeTutorial for the CSS corner bottom shape property.Try it
corner-end-end-shapeTutorial for the CSS corner end end shape property.Try it
corner-end-start-shapeTutorial for the CSS corner end start shape property.Try it
corner-inline-end-shapeTutorial for the CSS corner inline end shape property.Try it
corner-inline-start-shapeTutorial for the CSS corner inline start shape property.Try it
corner-left-shapeTutorial for the CSS corner left shape property.Try it
corner-right-shapeTutorial for the CSS corner right shape property.Try it
corner-shapeTutorial for the CSS corner shape property.Try it
corner-start-end-shapeTutorial for the CSS corner start end shape property.Try it
corner-start-start-shapeTutorial for the CSS corner start start shape property.Try it
corner-top-left-shapeTutorial for the CSS corner top left shape property.Try it
corner-top-right-shapeTutorial for the CSS corner top right shape property.Try it
corner-top-shapeTutorial for the CSS corner top shape property.Try it
counter-incrementTutorial for the CSS counter increment property.Try it
counter-resetTutorial for the CSS counter reset property.Try it
counter-setTutorial for the CSS counter set property.Try it
cursorTutorial for the CSS cursor property.Try it
cxTutorial for the CSS cx property.Try it
cyTutorial for the CSS cy property.Try it
dTutorial for the CSS d property.Try it
dominant-baselineTutorial for the CSS dominant baseline property.Try it
dynamic-range-limitTutorial for the CSS dynamic range limit property.Try it
field-sizingTutorial for the CSS field sizing property.Try it
fillTutorial for the CSS fill property.Try it
fill-opacityTutorial for the CSS fill opacity property.Try it
fill-ruleTutorial for the CSS fill rule property.Try it
flood-colorTutorial for the CSS flood color property.Try it
flood-opacityTutorial for the CSS flood opacity property.Try it
forced-color-adjustTutorial for the CSS forced color adjust property.Try it
frame-sizingTutorial for the CSS frame sizing property.Try it
hanging-punctuationTutorial for the CSS hanging punctuation property.Try it
hyphenate-characterTutorial for the CSS hyphenate character property.Try it
hyphenate-limit-charsTutorial for the CSS hyphenate limit chars property.Try it
hyphenate-limit-linesTutorial for the CSS hyphenate limit lines property.Try it
image-orientationTutorial for the CSS image orientation property.Try it
image-renderingTutorial for the CSS image rendering property.Try it
image-resolutionTutorial for the CSS image resolution property.Try it
initial-letterTutorial for the CSS initial letter property.Try it
interactivityTutorial for the CSS interactivity property.Try it
interest-delayTutorial for the CSS interest delay property.Try it
interest-delay-endTutorial for the CSS interest delay end property.Try it
interest-delay-startTutorial for the CSS interest delay start property.Try it
interpolate-sizeTutorial for the CSS interpolate size property.Try it
lighting-colorTutorial for the CSS lighting color property.Try it
line-breakTutorial for the CSS line break property.Try it
line-clampTutorial for the CSS line clamp property.Try it
link-parametersTutorial for the CSS link parameters property.Try it
markerTutorial for the CSS marker property.Try it
marker-endTutorial for the CSS marker end property.Try it
marker-midTutorial for the CSS marker mid property.Try it
marker-startTutorial for the CSS marker start property.Try it
maskTutorial for the CSS mask property.Try it
mask-borderTutorial for the CSS mask border property.Try it
mask-border-modeTutorial for the CSS mask border mode property.Try it
mask-border-outsetTutorial for the CSS mask border outset property.Try it
mask-border-repeatTutorial for the CSS mask border repeat property.Try it
mask-border-sliceTutorial for the CSS mask border slice property.Try it
mask-border-sourceTutorial for the CSS mask border source property.Try it
mask-border-widthTutorial for the CSS mask border width property.Try it
mask-clipTutorial for the CSS mask clip property.Try it
mask-compositeTutorial for the CSS mask composite property.Try it
mask-imageTutorial for the CSS mask image property.Try it
mask-modeTutorial for the CSS mask mode property.Try it
mask-originTutorial for the CSS mask origin property.Try it
mask-positionTutorial for the CSS mask position property.Try it
mask-repeatTutorial for the CSS mask repeat property.Try it
mask-sizeTutorial for the CSS mask size property.Try it
mask-typeTutorial for the CSS mask type property.Try it
math-depthTutorial for the CSS math depth property.Try it
math-shiftTutorial for the CSS math shift property.Try it
math-styleTutorial for the CSS math style property.Try it
object-fitTutorial for the CSS object fit property.Try it
object-positionTutorial for the CSS object position property.Try it
object-view-boxTutorial for the CSS object view box property.Try it
offsetTutorial for the CSS offset property.Try it
offset-anchorTutorial for the CSS offset anchor property.Try it
offset-distanceTutorial for the CSS offset distance property.Try it
offset-pathTutorial for the CSS offset path property.Try it
offset-positionTutorial for the CSS offset position property.Try it
offset-rotateTutorial for the CSS offset rotate property.Try it
orphansTutorial for the CSS orphans property.Try it
overlayTutorial for the CSS overlay property.Try it
overscroll-behaviorTutorial for the CSS overscroll behavior property.Try it
overscroll-behavior-blockTutorial for the CSS overscroll behavior block property.Try it
overscroll-behavior-inlineTutorial for the CSS overscroll behavior inline property.Try it
overscroll-behavior-xTutorial for the CSS overscroll behavior x property.Try it
overscroll-behavior-yTutorial for the CSS overscroll behavior y property.Try it
pageTutorial for the CSS page property.Try it
page-break-afterTutorial for the CSS page break after property.Try it
page-break-beforeTutorial for the CSS page break before property.Try it
page-break-insideTutorial for the CSS page break inside property.Try it
paint-orderTutorial for the CSS paint order property.Try it
path-lengthTutorial for the CSS path length property.Try it
perspectiveTutorial for the CSS perspective property.Try it
perspective-originTutorial for the CSS perspective origin property.Try it
place-contentTutorial for the CSS place content property.Try it
place-itemsTutorial for the CSS place items property.Try it
place-selfTutorial for the CSS place self property.Try it
pointer-eventsTutorial for the CSS pointer events property.Try it
print-color-adjustTutorial for the CSS print color adjust property.Try it
quotesTutorial for the CSS quotes property.Try it
rTutorial for the CSS r property.Try it
reading-flowTutorial for the CSS reading flow property.Try it
reading-orderTutorial for the CSS reading order property.Try it
resizeTutorial for the CSS resize property.Try it
rotateTutorial for the CSS rotate property.Try it
row-gapTutorial for the CSS row gap property.Try it
row-ruleTutorial for the CSS row rule property.Try it
row-rule-breakTutorial for the CSS row rule break property.Try it
row-rule-colorTutorial for the CSS row rule color property.Try it
row-rule-inset-capTutorial for the CSS row rule inset cap property.Try it
row-rule-inset-cap-endTutorial for the CSS row rule inset cap end property.Try it
row-rule-inset-cap-startTutorial for the CSS row rule inset cap start property.Try it
row-rule-inset-junctionTutorial for the CSS row rule inset junction property.Try it
row-rule-inset-junction-endTutorial for the CSS row rule inset junction end property.Try it
row-rule-inset-junction-startTutorial for the CSS row rule inset junction start property.Try it
row-rule-styleTutorial for the CSS row rule style property.Try it
row-rule-visibility-itemsTutorial for the CSS row rule visibility items property.Try it
row-rule-widthTutorial for the CSS row rule width property.Try it
ruby-alignTutorial for the CSS ruby align property.Try it
ruby-overhangTutorial for the CSS ruby overhang property.Try it
ruby-positionTutorial for the CSS ruby position property.Try it
ruleTutorial for the CSS rule property.Try it
rule-breakTutorial for the CSS rule break property.Try it
rule-colorTutorial for the CSS rule color property.Try it
rule-inset-capTutorial for the CSS rule inset cap property.Try it
rule-inset-junctionTutorial for the CSS rule inset junction property.Try it
rule-overlapTutorial for the CSS rule overlap property.Try it
rule-styleTutorial for the CSS rule style property.Try it
rule-visibility-itemsTutorial for the CSS rule visibility items property.Try it
rule-widthTutorial for the CSS rule width property.Try it
rxTutorial for the CSS rx property.Try it
ryTutorial for the CSS ry property.Try it
scaleTutorial for the CSS scale property.Try it
scroll-behaviorTutorial for the CSS scroll behavior property.Try it
scroll-initial-targetTutorial for the CSS scroll initial target property.Try it
scroll-marginTutorial for the CSS scroll margin property.Try it
scroll-margin-blockTutorial for the CSS scroll margin block property.Try it
scroll-margin-block-endTutorial for the CSS scroll margin block end property.Try it
scroll-margin-block-startTutorial for the CSS scroll margin block start property.Try it
scroll-margin-bottomTutorial for the CSS scroll margin bottom property.Try it
scroll-margin-inlineTutorial for the CSS scroll margin inline property.Try it
scroll-margin-inline-endTutorial for the CSS scroll margin inline end property.Try it
scroll-margin-inline-startTutorial for the CSS scroll margin inline start property.Try it
scroll-margin-leftTutorial for the CSS scroll margin left property.Try it
scroll-margin-rightTutorial for the CSS scroll margin right property.Try it
scroll-margin-topTutorial for the CSS scroll margin top property.Try it
scroll-marker-groupTutorial for the CSS scroll marker group property.Try it
scroll-paddingTutorial for the CSS scroll padding property.Try it
scroll-padding-blockTutorial for the CSS scroll padding block property.Try it
scroll-padding-block-endTutorial for the CSS scroll padding block end property.Try it
scroll-padding-block-startTutorial for the CSS scroll padding block start property.Try it
scroll-padding-bottomTutorial for the CSS scroll padding bottom property.Try it
scroll-padding-inlineTutorial for the CSS scroll padding inline property.Try it
scroll-padding-inline-endTutorial for the CSS scroll padding inline end property.Try it
scroll-padding-inline-startTutorial for the CSS scroll padding inline start property.Try it
scroll-padding-leftTutorial for the CSS scroll padding left property.Try it
scroll-padding-rightTutorial for the CSS scroll padding right property.Try it
scroll-padding-topTutorial for the CSS scroll padding top property.Try it
scroll-snap-alignTutorial for the CSS scroll snap align property.Try it
scroll-snap-stopTutorial for the CSS scroll snap stop property.Try it
scroll-snap-typeTutorial for the CSS scroll snap type property.Try it
scroll-target-groupTutorial for the CSS scroll target group property.Try it
scroll-timelineTutorial for the CSS scroll timeline property.Try it
scroll-timeline-axisTutorial for the CSS scroll timeline axis property.Try it
scroll-timeline-nameTutorial for the CSS scroll timeline name property.Try it
scrollbar-colorTutorial for the CSS scrollbar color property.Try it
scrollbar-gutterTutorial for the CSS scrollbar gutter property.Try it
scrollbar-widthTutorial for the CSS scrollbar width property.Try it
shape-image-thresholdTutorial for the CSS shape image threshold property.Try it
shape-marginTutorial for the CSS shape margin property.Try it
shape-outsideTutorial for the CSS shape outside property.Try it
shape-renderingTutorial for the CSS shape rendering property.Try it
speak-asTutorial for the CSS speak as property.Try it
stop-colorTutorial for the CSS stop color property.Try it
stop-opacityTutorial for the CSS stop opacity property.Try it
strokeTutorial for the CSS stroke property.Try it
stroke-dasharrayTutorial for the CSS stroke dasharray property.Try it
stroke-dashoffsetTutorial for the CSS stroke dashoffset property.Try it
stroke-linecapTutorial for the CSS stroke linecap property.Try it
stroke-linejoinTutorial for the CSS stroke linejoin property.Try it
stroke-miterlimitTutorial for the CSS stroke miterlimit property.Try it
stroke-opacityTutorial for the CSS stroke opacity property.Try it
stroke-widthTutorial for the CSS stroke width property.Try it
timeline-scopeTutorial for the CSS timeline scope property.Try it
touch-actionTutorial for the CSS touch action property.Try it
translateTutorial for the CSS translate property.Try it
user-modifyTutorial for the CSS user modify property.Try it
user-selectTutorial for the CSS user select property.Try it
vector-effectTutorial for the CSS vector effect property.Try it
vertical-alignTutorial for the CSS vertical align property.Try it
view-timelineTutorial for the CSS view timeline property.Try it
view-timeline-axisTutorial for the CSS view timeline axis property.Try it
view-timeline-insetTutorial for the CSS view timeline inset property.Try it
view-timeline-nameTutorial for the CSS view timeline name property.Try it
view-transition-classTutorial for the CSS view transition class property.Try it
view-transition-nameTutorial for the CSS view transition name property.Try it
view-transition-scopeTutorial for the CSS view transition scope property.Try it
widowsTutorial for the CSS widows property.Try it
will-changeTutorial for the CSS will change property.Try it
wrap-insideTutorial for the CSS wrap inside property.Try it
xTutorial for the CSS x property.Try it
yTutorial for the CSS y property.Try it
zoomTutorial for the CSS zoom property.Try it

Edge Cases & Pitfalls

Most CSS property mistakes are missing semicolons, box-model surprises, or invalid values.

;

Missing semicolons

Every declaration needs property: value;. Without the semicolon, the next line may be dropped.

box

width: 100% overflow

Padding and border can push past the parent unless you set box-sizing: border-box.

mg

Margin collapse

Vertical margins between adjacent blocks can merge. Use padding or a flex/grid gap when you need reliable spacing.

val

Invalid values

Browsers ignore declarations with the wrong value type. Check the property page for allowed units and keywords.

a11y

Removing outline

Do not set outline: none without a visible focus style. Keyboard users need a clear focus ring.

!

Overusing !important

It wins fights but makes overrides harder later. Fix specificity or source order instead when you can.

Browser Support

Core CSS properties—color, margin, padding, display, width, flex, and font-size—are Baseline CSS. Newer properties may vary; each property tutorial notes its own support.

✓ Baseline · Widely available

Core CSS properties

Essential styling properties work in all major browsers. Check individual guides for newer features.

100% core properties
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
Core CSS properties Universal

Bottom line: Learn color, spacing, and display first—they are production-safe everywhere. Newer properties document compatibility on their own pages.

Key Takeaways

  • Properties are property: value; settings inside a CSS rule.
  • Start with color, fonts, margin, padding, border, width, and display.
  • Box model: content → padding → border → margin; prefer border-box.
  • Next: color, margin, or the searchable index above.

One line: CSS properties style matching elements—learn declaration syntax, the box model, and a small starter set, then open guides from the index.

Frequently Asked Questions

A CSS property is the name in a declaration—color, margin, display, and so on. Paired with a value, it tells the browser how to style matching elements: selector { property: value; }.
The property is what you change (color). The value is how you change it (#2563eb or blue). Together they form one declaration that ends with a semicolon.
Start with color, font-size, font-family, margin, padding, border, width, height, and display. Those cover typography, spacing, and basic layout before Flexbox or Grid.
Every element has content, padding, border, and margin. Properties like width, padding, border, and margin control each layer. Use box-sizing: border-box so width includes padding and border.
Shorthand properties set several related longhands at once—margin sets all four sides; font can set size, family, and more. Learn shorthand first, then longhands when you need one side only.
Open color or margin from Getting Started in the index, or continue alphabetically with accent-color. Pair properties with CSS Selectors so you know what you are styling.

Start your first property tutorial

Open color or margin, or continue alphabetically with accent-color.

accent-color tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

10 people found this page helpful