CSS Min-Height Property

In this chapter you will learn:
About min-height property
Values of min-height property
Example of this property

CSS min-height property is used to set the minimum height of the element so if you have defined the min-height of any element then you can’t set the height of that element smaller than min-height.

Values of min-height property-
Values Description
% Used to set the minimum height in % (percent)
length Used to define minimum height in cm, px etc.
initial Used to specify the default value of the property.
inherit inherit value from parent element

Examples of this property-
  1. <html>
  2. <head>
  3. <title>Example of min-height property</title>
  4. <style type="text/css">
  5. div
  6. {
  7. min-height:120px;
  8. background-color:Gray;
  9. }
  10. </style>
  11. </head>
  12. <body>
  13. <div> This is the example of min-height property. <br/>
  14. The minimum height of this division has set to 120px so <br/>
  15. you can't set its height smaller than the min-height.</div>
  16. </body>
  17. </html>

Output:-
example of min-height
SUMMARY
In this chapter, you have learned about the min-height property with a given program so try it yourself and click on Next button to continue-
 

Share your thought