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