Javascript examples for CSS Style Property:minHeight
The minHeight property sets or gets the minimum height of an element.
Value | Description |
---|---|
length | minimum height in length units. Default is 0 |
% | minimum height in percentage of the parent element |
initial | Sets this property to its default value. |
inherit | Inherits this property from its parent element. |
Item | Value |
---|---|
Default Value: | 0 |
Return Value: | A String, representing the minimum height of an element |
CSS Version | CSS2 |
Set the minimum height of a <div> element:
<!DOCTYPE html> <html> <body> <div style="background:red;min-height:150px;" id="myDiv">This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</div><br> <button type="button" onclick="myFunction()">test</button> <script> function myFunction() {//w w w . ja v a 2 s . c o m document.getElementById("myDiv").style.minHeight = '110px'; } </script> </body> </html>