Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Box Model Basics | Styling Fundamentals
CSS Foundations

bookBox Model Basics

When you style elements in CSS, you are working with the box model. This model breaks every element down into four main parts, each affecting the element's appearance and how it interacts with other elements on the page.

First is the content area, which holds text, images, or other content. Directly surrounding the content is the padding. Padding creates space inside the element, between the content and the border. The border wraps around the padding and content, forming a visible outline or edge for the element. Finally, the margin is the space outside the border, separating the element from its neighbors.

Changing the padding increases the space between the content and the border, making the box appear larger without affecting the space outside. Adjusting the border adds thickness around the padding and content. Modifying the margin pushes other elements further away, creating separation between boxes on your page.

index.html

index.html

style.css

style.css

copy

With the example above, you can see how each part of the box model works together: the content is surrounded by padding, then a border, and finally margin that separates the box from everything else.

question mark

Which part of the box model creates space outside an element's border?

Select the correct answer

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 3

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

Awesome!

Completion rate improved to 6.67

bookBox Model Basics

Scorri per mostrare il menu

When you style elements in CSS, you are working with the box model. This model breaks every element down into four main parts, each affecting the element's appearance and how it interacts with other elements on the page.

First is the content area, which holds text, images, or other content. Directly surrounding the content is the padding. Padding creates space inside the element, between the content and the border. The border wraps around the padding and content, forming a visible outline or edge for the element. Finally, the margin is the space outside the border, separating the element from its neighbors.

Changing the padding increases the space between the content and the border, making the box appear larger without affecting the space outside. Adjusting the border adds thickness around the padding and content. Modifying the margin pushes other elements further away, creating separation between boxes on your page.

index.html

index.html

style.css

style.css

copy

With the example above, you can see how each part of the box model works together: the content is surrounded by padding, then a border, and finally margin that separates the box from everything else.

question mark

Which part of the box model creates space outside an element's border?

Select the correct answer

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 3
some-alt