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

CSS height property

CSS height property Bad Practice
CSS height property Best Practice

The height property sets the element's height. Same as width, its value doesn't include padding, border, or margin by default. The content of a section <div> with height: 96px; will take up exactly 96px vertically. However, to calculate the total size of the element, you'd need to add margins, borders, and padding size on both sides.

Pro Tip: Avoid setting fixed width and height unless necessary.

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