Learn CSS: Box Model and Layout
Understand how CSS sizes and spaces every element, inspect boxes in developer tools, switch to border-box sizing, and position elements with display, relative, absolute, fixed and sticky positioning, z-index and floats.
- Beginner level
- 4 modules
- 18 lessons
- 72 tasks and questions
Syllabus
01The Box ModelEvery element is a box of content, padding, border and margin. Size boxes, draw borders, add inner and outer space, centre blocks with auto margins, and inspect it all in developer tools.6 lessons
02Changing the Box ModelSwitch to border-box sizing, keep boxes flexible with minimum and maximum sizes, deal with overflowing content, and hide elements the right way.4 lessons
03Display and PositioningControl how boxes flow with display, nudge and pin them with relative and absolute positioning, keep them in view with fixed and sticky, layer them with z-index, and wrap text around them with floats.6 lessons
04Project and ReviewStyle the hostel's rooms page with the box model and positioning, then review the course with a quiz.2 lessons