Online Snippets Library

Set min height of Div in CSS

CSS min-height property is used to set min height of Div Or any element.min-height overrides the value of the height property so that element height can not be smaller than min-height.

Syntax

min-height: length|initial|inherit;

Example

<!DOCTYPE html>
<html>
<head>
<title>Set the min-height of an element in CSS | Tutsway.com</title>
<style type="text/css">
div {
    min-height: 400px;
    background-color: lightblue;
}
</style>
</head>
<body>
<h1>Set the min-height of an element</h1>
<div>
Hello Friends.
</div>
</body>
</html>