CSS Properties

Beginner
15 min read
Updated: Nov 2026
5 examples
335 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 (335 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

39 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-size-adjustTutorial for the CSS font size adjust property.Try it
font-stretchTutorial for the CSS font stretch property.Try it
font-styleTutorial for the CSS font style property.Try it
font-variantTutorial for the CSS font variant property.Try it
font-variant-capsTutorial for the CSS font variant caps property.Try it
font-weightTutorial for the CSS font weight 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
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-decorationTutorial for the CSS text decoration property.Try it
text-decoration-colorTutorial for the CSS text decoration color property.Try it
text-decoration-lineTutorial for the CSS text decoration line 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-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-shadowTutorial for the CSS text shadow 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
unicode-bidiTutorial for the CSS unicode bidi property.Try it
white-spaceTutorial for the CSS white space 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

92 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-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
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

15 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-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

16 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-sizeTutorial for the CSS background size property.Try it
caret-colorTutorial for the CSS caret color 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

17 tutorials

Transitions, animations, and transforms.

PropertyDescriptionTutorial
animationTutorial for the CSS animation 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-timing-functionTutorial for the CSS animation timing function property.Try it
transformTutorial for the CSS transform 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-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

24 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
contentTutorial for the CSS content 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-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
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

89 tutorials

Additional CSS properties — search or browse alphabetically.

PropertyDescriptionTutorial
allTutorial for the CSS all property.Try it
backface-visibilityTutorial for the CSS backface visibility property.Try it
box-decoration-breakTutorial for the CSS box decoration break 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-ruleTutorial for the CSS column rule property.Try it
column-rule-colorTutorial for the CSS column rule color property.Try it
column-rule-styleTutorial for the CSS column rule style 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
columnsTutorial for the CSS columns 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
hanging-punctuationTutorial for the CSS hanging punctuation property.Try it
hyphenate-characterTutorial for the CSS hyphenate character property.Try it
image-renderingTutorial for the CSS image rendering 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
object-fitTutorial for the CSS object fit property.Try it
object-positionTutorial for the CSS object position 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-rotateTutorial for the CSS offset rotate property.Try it
orphansTutorial for the CSS orphans 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
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
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
quotesTutorial for the CSS quotes 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
scaleTutorial for the CSS scale property.Try it
scroll-behaviorTutorial for the CSS scroll behavior 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-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
scrollbar-colorTutorial for the CSS scrollbar color property.Try it
translateTutorial for the CSS translate property.Try it
user-selectTutorial for the CSS user select property.Try it
vertical-alignTutorial for the CSS vertical align property.Try it
windowsTutorial for the CSS windows 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 →

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