i2tutorials

CSS min-height

CSS min-height

 

This CSS property defines the minimum height of the content area of an element. Min-height does not include padding, borders, or margins.

 

Syntax:

 

min-height:     length | percentage | initial | inherit

 

Property Values:

 

 

Example:

 

<!DOCTYPE html>
<html>
<head>
<title>
min-height property
</title>

<style>
p{
border: 4px solid blue;
background-color: lightblue;
font-size: 20px;
}
#px {
min-height: 50px;
}
#em {
min-height: 6em;

}

</style>
</head>
<body>
<h3> min-height: 50px; </h3>
<p id = "px">
Hi, Welcome to the I2Tutorials. Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.
</p>
<h3> min-height: 6em; </h3>
<p id = "em">
Hi, Welcome to the I2Tutorials. Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.Enter content here.
</p>

</body>
</html>

 

OUTPUT:

 

CSS min-height

 

 

 

 

Exit mobile version