HTML DOM maxHeight Property
Complete Style Object Reference
Definition and Usage
The maxHeight property sets the maximum height of an element.
Syntax
Object.style.maxHeight=length|%
|
Possible Values
Value |
Description |
length |
Defines the height in px, cm, etc. |
% |
Defines the max height in % of the containing block |
Example
The following example sets the maximum height of an element box:
<html>
<head>
<script type="text/javascript">
function setMaxHeight()
{
document.getElementById("p1").style.maxHeight="10px";
}
</script>
</head>
<body>
<p id="p1">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.</p>
<input type="button" onclick="setMaxHeight()"
value="Set max height" />
</body>
</html>
|
Try-It-Yourself Demos
maxHeight - Set max height of an element box
Complete Style Object Reference
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|