CSS
CSS Height and WidthCSS Height and Width
CSS controls the exact height and width of an element.
Read Time
5 min readDifficulty
BeginnerLast Updated
Jun 15, 2026Version
v1.0.0Introduction
CSS defines the physical dimensions of an element's content area. These properties do not include padding, borders, or margins. Setting these values ensures an element takes up the correct amount of space on the screen.
Example
Example
Key Points
- The `width` sets the horizontal size.
- The `height` sets the vertical size.
- Dimensions exclude padding and borders by default.
- You can use pixels or percentages.