CSS selectors choose which HTML elements to style. The element selector targets all elements of a given type — write the tag name without angle brackets.
The universal selector * matches every element on the page. It is most commonly used in a CSS reset to strip default browser margin and padding.
Interactive CSS Playground — Learn CSS Visually with a Live Editor
53 lessons across 18 chapters. Edit CSS and HTML, see results instantly. Free, no sign-up.
What's included
Features
About this tool
Most people struggle with CSS because they read about properties without seeing what they actually do. The CSS Playground flips that — you edit CSS in a live editor, the preview updates instantly, and you build a genuine understanding by doing rather than memorising.
The tool has 53 lessons across 18 chapters covering everything from basic selectors to modern production CSS: container queries, subgrid, CSS nesting, cascade layers, logical properties, blend modes, filters, scroll-driven animations, @property, clamp(), color-mix(), OKLCH, relative color syntax, clip-path, and mask-image. Each lesson provides a base HTML structure and starter CSS in a live split-pane editor — CSS on top, HTML below, preview on the right.
As you type, the preview updates in real time. The "Remove CSS" toggle strips all styles so you can see exactly what your CSS contributes. Responsive preview buttons (375px mobile, 768px tablet, full width) let you check how your layout responds at different widths. Quick Check challenges after key lessons reinforce learning through active recall. All progress is saved locally — no account required.
If you are a freelance designer or developer building your CSS skills, also check out the Freelance Rate Calculator to price your services correctly and the Freelance Invoice Generator to handle your billing — both run entirely in your browser.
Step by step
How to Use
- 1Pick a lessonBrowse the 18 chapters in the left sidebar. Click any lesson to load its HTML and CSS into the editors. Use the search box to filter lessons by name.
- 2Read the conceptThe collapsible panel above the editors explains what the lesson covers and why it matters — including the mental model behind the CSS property or technique.
- 3Edit CSS and HTMLThe CSS editor (top) and HTML editor (bottom) are both visible at once. Edit either and watch the preview update instantly. Drag the divider between them to resize.
- 4Use the toolbar buttonsFormat cleans up messy CSS. Remove CSS strips all styles so you can see the unstyled HTML. The responsive size buttons (375 / 768 / Full) resize the preview to check your layout.
- 5Answer the Quick CheckSome lessons end with a multiple-choice challenge. Your answers are saved — revisiting the lesson shows "✓ Challenge complete" if you already answered correctly.
- 6Move to the next lessonUse the Prev / Next buttons or click any lesson in the sidebar. Progress is saved to localStorage automatically.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
No prior experience is needed. The playground starts with the basics — what CSS selectors are, how to target elements, and what properties do. Each lesson provides working HTML + CSS code you can immediately edit and experiment with. The concept explanation above the editor explains the why, and the live preview shows the result instantly.
The playground covers 53 lessons across 18 chapters: Selectors, Colors, Typography, Box Model, Layout Basics, Flexbox, CSS Grid, Animations, CSS Variables, Pseudo-elements, Responsive Design, Modern Selectors, Modern Layout, Cascade & Layers, Visual Effects, Advanced Variables, Modern Color, and Clip & Mask.
Yes. The editor pane shows CSS and HTML editors stacked vertically — both visible at once. A draggable divider between them lets you adjust how much space each gets. Both editors update the live preview as you type. The Reset button restores the lesson's default code at any time.
Yes. Both your completed lessons and your current lesson position are saved to localStorage in your browser. When you return, the playground resumes where you left off with all completed lessons still marked. No account or login is required.
The preview is a sandboxed iframe that renders your HTML and CSS directly in the browser. As you type in the CSS or HTML editor, the preview updates after a short debounce (about 150ms). This means you see the effect of your changes almost instantly without any page reload or build step.
Some lessons include a Quick Check — a multiple-choice question about the concept you just learned. Click the answer you think is correct. Green means right; red shows the correct answer if you were wrong. These use active recall, one of the most effective learning techniques, to help cement what you've read.
Yes. Click the download (.html) button in the preview header to save the current HTML + CSS as a complete, self-contained HTML file you can open in any browser or deploy directly.
Yes — both are covered in depth. Flexbox spans 4 lessons: understanding the flex container, flex-direction and flex-wrap, justify-content and align-items, and controlling individual flex items with flex-grow, flex-shrink, and flex-basis. CSS Grid spans 3 lessons: the grid container and fr unit, grid-template-areas for named layouts, and column spanning with auto-placement using minmax() and auto-fill.