CSS Size (Dimension)


The CSS Dimension property allows you to control the height and width of an element. Likewise, it allows you to increase the line spacing.


Examples

More Examples

Set the height of the element

This example demonstrates how to set the height of different elements.

Use a percentage to set the height of the image

This example demonstrates how to set the height of an element using a percentage value.

Use the pixel value to set the width of the element

This example demonstrates how to use pixel values to set the width of an element.

Set the maximum height of the element

This example demonstrates how to set the maximum height of an element.

Use percentage to set the maximum width of the element

This example demonstrates how to use a percentage value to set the maximum width of an element.

Set the minimum height of the element

This example demonstrates how to set the minimum height of an element.

Use the pixel value to set the minimum width of the element

This example demonstrates how to use pixel values to set the minimum width of an element.


CSS Dimension Properties

PropertyDescription
heightSet the height of the element.
line-heightSet the row height.
max-heightSet the maximum height of the element.
max-widthSet the maximum width of the element.
min-heightSet the minimum height of the element.
min-widthSet the minimum width of the element.
widthSet the width of the element.