Defination:
CSS height and width properties are used to assign the height and width of an element. This property sets the height and width inside the padding of an element.
Height & Width Properties:
Height & Width Properties | Description |
height | height property is used to set an element’s height. |
width | width property is used to set an element’s width. |
min-height | min-height property is used to assign the minimum height of an element. |
max-height | max-height property is used to assign the maximum height of an element. |
min-width | min-width property is used to assign the minimum width of an element. |
max-width | max-width property is used to assign the maximum width of an element. |
CSS Height and Width Values
height & width value | Description |
auto | The browser auto calculates the height and width of an element. |
length | It used to assign the value in millimeters(mm), centimeters(cm), pixels(px), inches(in), points(pt) and so on. |
percentage (%) | It used to set the height and width property values in percentage. |
initial | Set the height and width value to its default value. |
inherit | Inherit its height and width value to its parent value. |
Donate to support writers
You may be interested in the following topics:
- CSS max-height
- CSS min-height
- CSS max-width
- CSS min-width
- CSS Width
- CSS Height
- CSS Height & Width (All Properties)