From the course: CSS Essential Training

Intro to the CSS box model - CSS Tutorial

From the course: CSS Essential Training

Intro to the CSS box model

- Now that we've gone over some core CSS concepts let's continue to build on that understanding by exploring the CSS box model. An important concept that explains how HTML elements are displayed in the browser. When we look at a webpage, we see text and images but to the browser, every single element is displayed as a rectangular box, whether it's an image, a paragraph, or even a link inside of a paragraph. Each of those HTML elements is an individual box. The CSS box model is a set of rules that define how these boxes are sized and how much space they take up. In this chapter, we'll talk about the five properties that make up the box model width, height, padding, margin, and border. This is the foundation of layout on the web. So before we can incorporate methods like Floats, Flexbox, or Grid, we first need to understand the box model.

Contents