CSS Height and Width Properties

CSS includes height and width properties to help you specify the size of your elements.

height and width Properties

Applies to all HTML elements except non-replaced inline elements, table columns and column groups.

You can use a fixed height (i.e. pixels) or a percentage height. For more info, see height and width.

max-height and max-width Properties

Enables you to constrain the height and/or width of an element to a maximum value. For more information, see max-height and max-width.

min-height and min-width Properties

Enables you to constrain the height and/or width of an element to a minimum value. For more info, see min-height and min-width

Note that height and width can be affected by borders and padding. We cover this later in the tutorial, and show you how you can deal with this issue.