Code24Lab
Web Development Beginner

CSS Foundations: Selectors, Colours, Text & the Box Model

Style a fictional bakery website from the first rule to a finished product card: selectors, the cascade, specificity, colours, units, typography, the box model, backgrounds, display and position, with every answer checked as you go.

21 lessons 21 labs Certificate

  • One-time payment
  • Instant access right after payment
  • Secure checkout with Stripe

About this course

Style a fictional bakery website from its first rule to a finished product card. In 21 interactive labs you read real CSS and work out what the browser does: which elements a selector hits, which declaration wins the cascade, how specificity is scored, how hex colours and contrast ratios are calculated, how px, em, rem, vw and clamp() turn into pixels, and how wide a box really is with content-box or border-box. You also handle margin collapsing, background cover and contain, display and position. Every answer is checked instantly, and a final exam earns your certificate.

Lessons

  1. How CSS Works: Rules, Selectors and DeclarationsLabFree
  2. Type, Class, ID and Universal SelectorsLab Locked
  3. Combinators: Descendant, Child and Sibling SelectorsLab Locked
  4. Pseudo-classes: :hover, :first-child and :nth-childLab Locked
  5. The Cascade: Source Order and !importantLab Locked
  6. Specificity: Which Selector Wins?Lab Locked
  7. Inheritance and Computed ValuesLab Locked
  8. Colours: Hex, rgb() and TransparencyLab Locked
  9. Colour Contrast: Readable TextLab Locked
  10. Units: px, em, rem and %Lab Locked
  11. Viewport Units, Percentages and clamp()Lab Locked
  12. Typography: Type Scale, Line Height and Line LengthLab Locked
  13. The Box Model: Content, Padding, Border, MarginLab Locked
  14. Margin and Padding Shorthand: 1 to 4 ValuesLab Locked
  15. box-sizing: border-box and Why Everyone Uses ItLab Locked
  16. Margin Collapsing Between BlocksLab Locked
  17. Backgrounds: Images, cover, contain and PositionLab Locked
  18. display: block, inline, inline-block and noneLab Locked
  19. Position: relative, absolute, fixed and z-indexLab Locked
  20. min-width, max-width and overflowLab Locked
  21. Project: The Maple & Moss Product CardLab Locked