Overview
Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Explore a critical examination of the widely-adopted CSS practice of using `box-sizing: border-box` and discover when the newer `context-box` value might be a better choice for modern web development. Learn about the specific problems that arise when using `border-box` on container and wrapper elements, and understand how `context-box` can provide solutions for these layout challenges. Examine how modern CSS development has evolved beyond frequently declaring explicit sizes, making the traditional benefits of `border-box` less relevant in contemporary workflows. Discover why `context-box` often provides superior behavior for height calculations and layout management. Analyze specific scenarios where `border-box` still makes sense versus situations where it may be unnecessary altogether. Gain practical insights into when and how to implement these box-sizing strategies, including important considerations for maintaining existing projects while adopting new approaches in future work.
Syllabus
00:00 - Introduction
00:21 - The problem with border-box on container/wrapper
02:26 - Using box-sizing: context-box to fix it
03:48 - We don’t declare sizes that often anymore
05:00 - Heights with context-box are often better too
07:20 - The times when border-box does make more sense
08:55 - Except maybe we don’t need it after all
10:20 - You probably don’t want to remove it for old projects
10:43 - CSS Demystified
Taught by
Kevin Powell