CSS cascade, layout, and debugging
- •
Cascade and specificity
- •
Inheritance
- •
selected properties pass form a parent to descendants when the child has no stronger declaration
- •
Inheritance -> part of value selection, but is distinct from the cascade
- •
inspect computes styles and the winning rule when a declaration hasno visible effect
- •
{{renderer :bermaid}}
- •
graph TD A[Competing declarations for one property] --> B[1. Origin, layer, importance] B -->|One wins| W[Winning declaration] B -->|Tie| C[2. Specificity] C -->|One wins| W C -->|Tie| D[3. Source order - last wins] D --> W W --> X[Example: id rule color red wins at 1-0-0]
- •
- •
- •
- •
Responsive behavior
- •
adapt layouts to viewport and content constraints with fluid sizing, flexible layouts, and breakpoints where useful
- •
overflow controls content beyond a box; clipping can hide content, while scrolling can make it accessble
- •
a stacking context constrains descendant layering, so a large z-index cannot always escape its parent
- •
- •