CSS Properties

Beginner
⏱️ 15 min read
📚 Updated: Jul 2026
🎯 335 Tutorials
Reference

What You’ll Learn

CSS properties control every visual aspect of HTML elements — color, spacing, layout, typography, animation, and more. This hub links to 335 property tutorials, each with syntax, four try-it examples, and FAQs.

01

Syntax

property: value

02

Text

color, font.

03

Box

margin, pad.

04

Layout

display, flex.

05

Motion

animation.

06

335 guides

Full index.

Introduction

CSS properties are the building blocks of styling. Each property controls one aspect of an element’s appearance or layout. Explore the most commonly used properties to style HTML elements effectively — covering text, layout, box model, color, and positioning.

What Is a CSS Property?

A property is the name in a CSS declaration. The browser reads the property, applies the value, and renders the result. Hundreds of properties exist; you do not need to memorize all of them — learn the essentials, then search this index when you need a specific one.

💡
Beginner Tip

Every rule follows selector { property: value; }. Start with color, font-size, margin, and padding — they cover most beginner styling needs.

The CSS Box Model

Understanding the box model helps you use sizing and spacing properties correctly:

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

📝 Syntax

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

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

Property groups

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

⚡ Quick Reference

PropertyCommon valueEffect
color#2563ebText color
font-size1remText size
margin1remOuter spacing
padding1remInner spacing
displayflexFlexbox layout
background-color#f1f5f9Background fill

When to Use Which Properties

  • Typographycolor, font-*, text-* for readable text.
  • Spacingmargin and padding to separate elements.
  • Layoutdisplay, flex, grid for structure.
  • Sizingwidth, height, max-width for dimensions.
  • Visual effectsborder, box-shadow, opacity for polish.

👀 Live Preview

A box styled with common properties:

color · padding · background · border · border-radius

CSS Property Tutorial Index

Search by property name or browse by category. Every tutorial links to a full guide with four try-it examples and FAQs.

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

Examples Gallery

Five starter snippets using the most common CSS properties. Open linked tutorials for live try-it editors.

🔠 Text & Typography

Color and font properties for readable text.

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

color sets the text fill. font-size and font-family control size and typeface.

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

margin pushes other elements away. padding adds space inside the border before the content.

📈 Layout & Background

Size elements and fill backgrounds.

Example 3 — Width & Display

Control element size and layout mode.

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

How It Works

width and height set dimensions. display: block makes the element take full available width by default.

Example 4 — Background & 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

background-color fills the box. border and border-radius define the edge and corner rounding.

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

display: flex enables Flexbox. gap spaces items; align-items: center vertically centers them.

💬 Usage Tips

  • Shorthand first — Learn margin, padding, border, and font shorthands before longhands.
  • DevTools inspect — Right-click any element to see which properties apply.
  • One change at a time — When learning, change one property per save to see its effect.
  • Use rem for fontsfont-size: 1rem scales with user preferences.
  • Search this index — Jump directly to any of 335 property pages.

⚠️ Common Pitfalls

  • Missing semicolons — Every declaration needs property: value;
  • Margin collapse — Vertical margins between blocks can merge unexpectedly.
  • width: 100% overflow — Padding and border can push past the parent without box-sizing: border-box.
  • Invalid values — Browsers ignore declarations with wrong value types.
  • Over-specificity — Too many overrides make debugging harder.

♿ Accessibility

  • Color contrast — Use the color property with sufficient contrast ratios.
  • Readable font-size — Avoid tiny fixed sizes; prefer rem.
  • Focus outlines — Do not remove outline without a replacement focus style.
  • Motion — Respect prefers-reduced-motion when using animation properties.
  • Touch targets — Use adequate padding on interactive elements.

🧠 How CSS Properties Work

1

Selector matches elements

Rules target HTML elements, classes, or IDs that match the selector.

Match
2

Declarations apply properties

Each property: value pair sets one aspect of the element’s style.

Apply
3

Cascade resolves conflicts

Specificity, source order, and importance determine which value wins.

Cascade
=

Styled page

Typography, spacing, layout, and effects combine into the final design.

🖥 Browser Compatibility

Core CSS properties like color, margin, padding, display, and width have 100% browser support. Newer properties may vary — check individual tutorials.

Baseline · Universal support

Core CSS properties

Essential properties work in all major browsers. Each tutorial page notes support for that specific property.

100% Core properties
Google Chrome All versions · External CSS
Full support
Mozilla Firefox All versions · External CSS
Full support
Apple Safari All versions · External CSS
Full support
Microsoft Edge All versions · External CSS
Full support
Opera All modern versions
Full support
Core CSS properties 100% supported

Bottom line: Properties like color, margin, display, and flex are production-safe. Newer properties (e.g. accent-color) have dedicated compatibility notes on their tutorial pages.

🎉 Conclusion

CSS properties are how you transform plain HTML into polished, responsive designs. Start with the Getting Started tutorials, then use the searchable index to explore all 335 properties.

Each property page includes syntax, four try-it examples, browser support, and FAQs. Pair properties with selectors, media queries, and layout systems for complete stylesheets.

💡 Best Practices

✅ Do

  • Learn box model properties first
  • Use box-sizing: border-box
  • Prefer rem for font-size
  • Group related properties in stylesheets
  • Check individual pages for newer properties

❌ Don’t

  • Inline styles for entire sites
  • Use !important as a first fix
  • Memorize all 335 names at once
  • Remove focus outlines without replacement
  • Mix px and rem randomly without reason

Key Takeaways

Knowledge Unlocked

Five things to remember about CSS properties

Your gateway to 335 property tutorials.

5
Core concepts
Aa 02

Text

color, font.

Type
box 03

Box

margin, pad.

Space
fx 04

Layout

display.

Place
335 05

Index

Search all.

Ref

❓ Frequently Asked Questions

A CSS property is a style setting you apply to elements — such as color, margin, or display. Each property accepts one or more values: selector { property: value; }.
Write a selector, then a declaration block with property-value pairs separated by colons and ending with semicolons: p { color: blue; font-size: 16px; }.
Start with color, font-size, font-family, margin, padding, border, width, height, and display. These cover typography, spacing, and basic layout.
The property is what you want to change (e.g. color). The value is how you want to change it (e.g. red or #ff0000). Together they form a declaration.
Every element has content, padding, border, and margin layers. Properties like width, padding, border, and margin control each layer's size and spacing.
Read the overview, try the five examples, then open color or margin from Getting Started. Use the search box to find any of the 335 property tutorials.

Start Your First Property Tutorial

Open color or margin from Getting Started, or search the full index above.

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