Sets or retrieves the minimum height for an element.
Syntax
HTML |
{ min-height : sMinHeight }
|
---|
Scripting | object.style.minHeight(v) [ = sMinHeight ] |
---|
Possible Values
sMinHeight | Variant that
specifies or receives the minimum height for an element.length | Floating-point number followed by an absolute units designator (cm, mm, in, pt, pc, or px) or a relative units designator (em or ex). For more information about the supported length units, see CSS Length Units. | percentage | Integer followed by a % that specifies a percentage of the containing block height to use as the minimum height of the element. If the height of the containing block is not explicitly set, then the element has no minimum height and the minHeight property is interpreted as 0%. For more information on containing blocks and how its height is computed, see the Cascading Style Sheets, Level 2 (CSS2) specification. |
|
The property is read/write
for all objects except the following, for which it is read-only:
currentStyle.
The property has no default value. The Cascading Style Sheets (CSS) attribute is
not inherited.
Remarks
With Internet Explorer 6, this property applies only to td, th and tr elements in fixed-layout tables. Auto-layout tables are the default. To create a fixed-layout table, set the tableLayout property of a table element to fixed. The advantage of fixed-layout tables is they render faster than auto-layout tables.
Example
The following example shows the benefits of using the min-height attribute over the HEIGHT attribute for a TR element.
<HTML>
<HEAD>
<TITLE>CSS Min-Height Property Example</TITLE>
</HEAD>
<BODY>
<table border="1" style="table-layout:fixed; width:100%;">
<tr>
<td style="height:35px;background-color:#99CCFF">This cell has the
<b>height</b> attribute set to 35px. In Internet Explorer, overflow text
is clipped when <b>height</b> is set on cells or rows in fixed-layout tables.
Setting the <b>min-height</b> attribute, however, accomodates overflow text
by increasing the cell or row height.</td>
</tr>
<tr>
<td style="min-height:35px;background-color:#99CCFF">This cell has the
<b>min-height</b> attribute set to 35px. In Internet Explorer, overflow text
is clipped when <b>height</b> is set on cells or rows in fixed-layout tables.
Setting the <b>min-height</b> attribute, however, accomodates overflow text
by increasing the cell or row height.</td>
</tr>
</table>
</BODY>
</HTML>
This feature requires Microsoft® Internet Explorer 6 or later. Click the following icon to install the latest version. Then reload this page to view the sample.
Standards Information
This property is defined in
Cascading Style Sheets (CSS), Level 2 (CSS2) .
Applies To
See Also
CSS Enhancements in Internet Explorer 6, height