Web Development · Revision notes
CSS3 & Modern Styling Architecture
CSS controls presentation. This chapter covers selectors and specificity, the box model, units, positioning and stacking, Flexbox and Grid layouts, responsive media queries, custom properties for theming, and transitions, animations and transforms.
Quick revision
- selectors: type < class < id; combinators > + ~ and space
- specificity: inline > id > class > element; tie = later rule
- content+padding+border+margin; border-box reset
- rem for text, % / fr for layout, clamp() for fluid, dvh for mobile height
- none removes, hidden keeps space, opacity:0 stays interactive
- static/relative/absolute/fixed/sticky; absolute needs positioned parent
- z-index only within the same stacking context
- Flex = 1D, justify = main axis, align-items = cross axis