<?xml version="1.0" encoding="utf-8"?>

CSS box model properties

CSS box model properties Bad Practice
CSS box model properties Best Practice

Basically, the CSS box model is a set of rules that define how every web page on the Internet is rendered. You can set each box's size separately with associated properties.

To set the size of the content area, we use the width and height and related properties.[1]

For padding, border, and margin, we use properties with the same name — padding, border, and margin — as well as specific properties for each side of the element.

If we don't specify any of these properties, browsers will use their default values for specific elements, for example:

body {

margin: 8px;

}

Improve your UX & Product skills with interactive courses that actually work