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 | fit-content() Property
- CSS | content Property
- How to align content of a div to the bottom using CSS ?
- HTML | content Attribute
- CSS | justify-content Property
- How to use a div as content for Twitter's Popover?
- jQuery | Get Content and Attributes
- CSS | align-content property
- jQuery | Set Content and Attributes
- How to copy the content of a div into another div using jQuery ?
- CSS | max-height Property
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