Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Box Sizing and Width Control | The Box Model and Spacing
CSS Fundamentals

bookBox Sizing and Width Control

Swipe to show menu

The box-sizing property is used to control how the total size of an element is calculated, specifically concerning its width and height. There are three possible values for the box-sizing property. Let's break down what each of these values means:

box-sizing: content-box | border-box | inherit;
index.html

index.html

styles.css

styles.css

copy

Output

inherit

The inherit value allows an element's box-sizing property to inherit its value from its parent element. This means that the box-sizing behavior of the current element is determined by the box-sizing property of its parent element.

question mark

What is the default value for the box-sizing property?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 3

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Section 3. Chapter 3
some-alt