Syntax Selectors Colors Backgrounds Borders Margins Padding Height/Width Box Model Outline Text Fonts Links Lists Tables Display Max-width Position Z-index Overflow Float Inline-block Align Rounded Gradients Shadows Text FX Tooltips Opacity Buttons

CSS Playground Part 1

Every CSS Property, Visual

30 interactive labs. Drag sliders, pick options, watch CSS happen. Copy the code when you're ready.

Lab 1

CSS Syntax

Learn the anatomy of a CSS rule — every part has a name. Hover the labels to highlight each piece.

Declarations
Example Rule
Show Comments
Anatomy Key
Selector — WHAT to style
Property — WHICH style to change
Value — HOW to style it
Punctuation — { } : ;
Declaration — property + value pair
Lab 2

CSS Selectors

Selectors tell CSS WHICH elements to style. Pick a selector to see exactly what it targets, why, and when to use it.

Category
Selector

Element Selector

Lab 3

CSS Colors

Colors can be set as names, hex codes, RGB, or HSL. See all formats for the same color.

Pick a Color
Red: 41
Green: 151
Blue: 255
Alpha: 1
Quick Colors
Lab 4

CSS Backgrounds

Background color, gradients, size, repeat, and position.

Background Type
Color 1
Color 2
Angle: 135°
Border Radius: 12px
Presets
Lab 5

CSS Borders

Width, style, color, and radius — all on one box.

Border Width: 3px
Style
Color
Radius: 8px
Individual Sides
Lab 6

CSS Margins

Space OUTSIDE an element. Pushes other elements away. The orange area shows the margin.

Top: 20px
Right: 20px
Bottom: 20px
Left: 20px
Auto Center
Lab 7

CSS Padding

Space INSIDE an element. Background color extends into padding. The green area shows padding.

Top: 20px
Right: 20px
Bottom: 20px
Left: 20px
Lab 8

CSS Height & Width

Set exact dimensions in px, %, or auto.

Width: 200px
Height: 100px
Max-Width: none
Unit
Lab 9

CSS Box Model

Margin + Border + Padding + Content = the full box. Toggle box-sizing to see the difference.

Width: 200px
Padding: 20px
Border: 3px
Margin: 16px
box-sizing

Total: 246 × 146px

Lab 10

CSS Outline

Outline is like border but doesn't take up space and can be offset.

Width: 3px
Style
Color
Offset: 0px
Lab 11

CSS Text

Alignment, decoration, transform, spacing, shadow.

text-align
text-decoration
text-transform
letter-spacing: 0em
word-spacing: 0px
line-height: 1.6
text-shadow
Color
Lab 12

CSS Fonts

Family, size, weight, and style.

font-family
font-size: 1rem
font-weight: 400
font-style
Lab 14

CSS Lists

Bullet style, position, and custom list styling.

list-style-type
list-style-position
Spacing: 8px
Lab 15

CSS Tables

Border collapse, striped rows, hover effects.

border-collapse
Striped Rows
Hover Highlight
Cell Padding: 10px
Header Color
Lab 16

CSS Display

Block, inline, inline-block, none, flex, grid — how elements flow on the page.

display

block: Takes full width. Stacks vertically. Height/width work. (div, p, h1)

Lab 17

CSS Max-width

max-width limits how wide an element can get. Essential for responsive design.

width: 100%
max-width: 400px
Centering
Lab 18

CSS Position

static, relative, absolute, fixed, sticky — how elements are placed on the page.

position
top: 0px
left: 0px

static: Default. Normal flow. top/left have NO effect.

Lab 19

CSS Z-index

z-index controls stacking order. Higher number = on top. Only works on positioned elements.

Blue z-index: 1
Green z-index: 2
Gold z-index: 3
Lab 20

CSS Overflow

What happens when content is bigger than its container?

overflow
Container Height: 120px
Lab 21

CSS Float

Float pushes an element to the left or right, and text wraps around it.

float
Box Width: 100px
Lab 22

CSS Inline-block

inline-block flows like text but respects width/height. Compare all three display types.

Display Type
Width: 100px
Height: 60px
Lab 23

CSS Align

Center text, center a block, center vertically — the most common alignment patterns.

Alignment Method
Lab 24

CSS Rounded Corners

border-radius rounds corners. Use one value for all, or control each corner independently.

All Corners: 12px
Individual Corners
Top-Left: 12px
Top-Right: 12px
Bottom-Right: 12px
Bottom-Left: 12px
Presets
Lab 25

CSS Gradients

Linear, radial, conic — smooth transitions between colors.

Type
Color 1
Color 2
Color 3 (optional)
Use 3rd color
Angle: 135°
Presets
Lab 26

CSS Shadows

box-shadow adds shadow to elements, text-shadow adds shadow to text.

Shadow Type
Offset X: 0px
Offset Y: 10px
Blur: 25px
Spread: 0px
Color
Opacity: 0.4
Inset
Presets
Lab 27

CSS Text Effects

Gradient text, text-overflow, text-stroke, word-break, and writing-mode.

Effect
Color 1
Color 2
Stroke Width: 1px
Lab 28

CSS Tooltips

Tooltips appear on hover — built with pure CSS using ::after and :hover.

Position
Background
Text Color
Arrow
Tooltip Text
Lab 29

CSS Opacity

opacity makes the entire element transparent. Compare with rgba() which only affects color.

opacity: 1
Element Color

opacity affects the ENTIRE element — background, text, borders, children. Everything fades.

rgba() only affects the specific property it's applied to. Text can stay opaque while background fades.

Lab 30

CSS Buttons

Build any button style — solid, gradient, outline, ghost. Add hover effects.

Style
Color
Padding: 14px
Border Radius: 12px
Font Size: 0.95rem
Hover Effect
Size Presets