min-height Attribute | minHeight Property
| DHTML文档教程 |
Sets or retrieves the minimum height for an element.
dhtml语法
HTML |
{ min-height : sMinHeight }
|
---|
Scripting | object.style.minHeight(v) [ = sMinHeight ] |
---|
DHTML可能的值
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.
DHTML代码范例
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.
是否符合公共标准
This property is defined in
Cascading Style Sheets (CSS), Level 2 (CSS2) .
Applies To
更多语法参考
css enhancements in internet explorer 6, height