CSS3 Cheatsheet
CSS3
Styling
Web
Frontend
Complete reference for CSS3 properties, selectors, layouts, animations, and modern styling techniques for creating beautiful and responsive web designs.
Quick Reference
🎨 Typography & Colors
Font properties, text styling, and color systems
📦 Box Model & Layout
Positioning, spacing, borders, and backgrounds
🔧 Flexbox & Grid
Modern layout systems for responsive design
✨ Animations & Media Queries
Transitions, animations, and responsive design
Font Properties
Font properties allow you to control the appearance of text, including family, size, weight, and style.
Font Family and Style
Font family declaration
Font style variations
Font variants
Font weight options
Font size units
Font shorthand property
Text Properties
Text properties control text alignment, spacing, decoration, and transformation for better typography.
Text Alignment and Spacing
Text alignment options
Letter and word spacing
Text indentation
Line height control
Text Decoration and Transform
Text decoration styles
Text transformation
Background Properties
Background properties control the visual backdrop of elements, including colors, images, and positioning.
Background Images and Colors
Background image setup
Background color options
Background shorthand
Border Properties
Border properties define the outline of elements with customizable width, style, color, and radius.
Border Styles and Dimensions
Border width and style
Border radius for rounded corners
Individual border sides
Border shorthand
Box Model Properties
The CSS box model consists of content, padding, border, and margin. Understanding this is crucial for proper layout control.
Positioning and Layout
Display types
Positioning methods
Float and clear
Dimensions and Spacing
Width and height
Margin and padding
Overflow control
Visibility and opacity
Box sizing
Color Systems
CSS supports multiple color formats including named colors, hex, RGB, HSL, and with alpha transparency.
Color Formats
Different color representations
Table Styling
Table Properties
Table layout and spacing
Column Layout
Multi-column Properties
Column configuration
List Styling
List and Marker Properties
List style customization
Animations
CSS animations bring your designs to life with smooth transitions and keyframe-based animations.
Animation Properties
Animation configuration
Animation shorthand
Keyframes definition
Transitions
Transition Properties
Smooth state changes
Transition shorthand
CSS Flexbox
Flexbox is a powerful one-dimensional layout method for arranging items in rows or columns with flexible sizing.
Flex Container Properties
Flex container setup
Flex Item Properties
Flex item behavior
CSS Grid
CSS Grid is a powerful two-dimensional layout system perfect for complex layouts and responsive designs.
Grid Container Properties
Grid container setup
Grid Item Properties
Grid item positioning
Media Queries
Media queries are essential for responsive design, allowing different styles for different devices and screen sizes.
Responsive Breakpoints
Standard device breakpoints
Common responsive patterns
Advanced Media Queries
Orientation and device features
Modern CSS Features
CSS Custom Properties (Variables)
CSS variables
CSS Functions
Useful CSS functions
Best Practices
Follow these CSS3 best practices for maintainable, performant, and accessible stylesheets.
- Use semantic class names that describe content, not appearance
- Implement mobile-first design with progressive enhancement
- Utilize CSS Grid and Flexbox for modern layout solutions
- Optimize performance by minimizing reflows and repaints
- Use CSS custom properties for consistent theming
- Follow BEM methodology for scalable CSS architecture
- Validate your CSS and test across different browsers
- Consider accessibility with proper contrast ratios and focus states
- Use CSS animations sparingly and respect user preferences for reduced motion
Learn More
Explore comprehensive CSS3 documentation and advanced styling techniques
Written by
Deepak Jangra
Created At
Wed Jan 15 2025
Updated At
Fri Jun 13 2025