Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Box Sizing and Width Control | Bokmodellen og Avstand
CSS-Grunnleggende

Box Sizing and Width Control

Sveip for å vise menyen

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

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?

Velg det helt riktige svaret

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 3

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Seksjon 3. Kapittel 3
some-alt