Search pages
Search all CSS Showcase pages by name
Basic CSS
The foundation of web styling — where every brilliant design begins
Why CSS Matters
Toggle between raw HTML and styled HTML to see the dramatic difference CSS makes. The same content, transformed by a few dozen lines of styling.
Welcome to My Website
This is an example paragraph showing the difference CSS makes. Without styling, HTML elements use the browser's default appearance.
“CSS is the language that brings beauty to the web.”
With CSS: custom fonts, colours, spacing, and visual hierarchy transform raw content into a designed experience.
CSS Selectors
Selectors are the backbone of CSS — they let you target HTML elements with surgical precision. From simple element selectors to complex pseudo-selectors, mastering these is essential.
This paragraph is styled with an element selector
This span has different stylingClasses add reusable styles
Multiple classes? No problem!
Different class, different style
IDs are unique — use sparingly!
Prefer classes for reusability
- First item (special styling)
- Regular item
- Regular item
- Last item (special styling)
Direct child paragraph
Nested paragraph (descendant)
Another direct child
Adjacent siblingEssential CSS Properties
CSS properties are the tools that bring your designs to life. Here are the fundamental properties every developer should master.
Hex colour: #2563eb
RGB: rgb(37, 99, 235)
HSL: hsl(217, 91%, 60%)
Gradient background
Bold and Large
Italic with letter spacing
Uppercase text
This paragraph has increased line height for better readability. Notice how the text breathes with proper spacing.
The Cascade & Specificity
Understanding how CSS rules cascade and which styles take precedence is crucial for writing maintainable stylesheets. It's like a pecking order for your styles!
Which colour wins? (Hint: it's green!)
Child inherits colour and font-size
But can override inherited styles
This text is red, despite other rules
CSS Units
Choosing the right unit is like picking the right tool for the job. From pixels to percentages, each has its perfect use case.
Pro Tips
Start with a Reset
Use a CSS reset or normalise stylesheet to ensure consistent styling across browsers.
Specificity Over !important
Instead of reaching for !important, understand and use specificity properly.
REM for Consistency
Use REM units for sizes to respect user's font preferences and ensure scalability.
Ready for More?
You've mastered the basics! Time to explore how these fundamentals come together in more complex scenarios.