CSS Dimension
The CSS Dimension property allows you to control the height and width of elements. Similarly, it allows you to increase line spacing.
More Examples
This example demonstrates how to set the height of different elements.
Set the height of an image using percentage
This example demonstrates how to set the height of an element using percentage values.
Set the width of an element using pixel values
This example demonstrates how to set the width of an element using pixel values.
Set the maximum height of an element
This example demonstrates how to set the maximum height of an element.
Set the maximum width of an element using percentage
This example demonstrates how to set the maximum width of an element using percentage values.
Set the minimum height of an element
This example demonstrates how to set the minimum height of an element.
Set the minimum width of an element using pixel values
This example demonstrates how to set the minimum width of an element using pixel values.
All CSS Dimension Properties
Property | Description |
---|---|
height | Sets the height of an element. |
line-height | Sets the line height. |
max-height | Sets the maximum height of an element. |
max-width | Sets the maximum width of an element. |
min-height | Sets the minimum height of an element. |
min-width | Sets the minimum width of an element. |
width | Sets the width of an element. |