The height property is used to set the height of an element. The height property does not contains padding, margin and border of element. The height property contains many values which define the height of an element. The height property values are listed below:
- height: auto; It is used to set height property to its default value. If the height property set to auto then the browser calculates the height of element.
- height: length; It is used to set the height of element in form of px, cm etc. The length can not be negative.
- height: initial; It is used to set height property to its default value.
- height: inherit; It is used to set height property from its parent element.
Example 1: This example use height: auto; property to display the content.
Example 2: Thie example use height: inherit property to display the content.
- How to make flexbox children 100% height of their parent using CSS?
- PHP | XMLReader expand() Function
- HTML width/height Attribute vs CSS width/height Property
- CSS | content Property
- How to set div width to fit content using CSS ?
- How to remove SVG content?
- CSS | fit-content() Property
- CSS | Height and Width
- How to change the height of br tag?
- CSS | max-height Property
- CSS | min-height Property
- p5.js | height variable
- CSS | height Property
- HTML | content Attribute
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : shubham_singh