Back to Topics

CSS Box Model

What is the Box Model?

The CSS Box Model is the foundation of web layout. Every element on a web page is represented as a rectangular box, which determines how much space it takes up and how it interacts with other elements.

Core Components

Example Syntax

.box {
  width: 300px;
  padding: 20px;
  border: 5px solid #ec4899;
  margin: 15px;
}
View My Practice Work