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?
- CSS | content Property
- HTML | content Attribute
- CSS | justify-content Property
- CSS | align-content property
- jQuery | Get Content and Attributes
- jQuery | Set Content and Attributes
- How to align content of a div to the bottom using CSS ?
- Adding HTML entities using CSS content
- Resize an iframe based on the content
- HTML | <meta> 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 email@example.com. 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