国产chinesehdxxxx野外,国产av无码专区亚洲av琪琪,播放男人添女人下边视频,成人国产精品一区二区免费看,chinese丰满人妻videos

HTML DOM Style maxHeight 屬性

2018-08-04 20:41 更新

Style maxHeight 屬性

Style 對(duì)象參考手冊(cè) Style 對(duì)象

定義和用法

maxHeight 屬性設(shè)置或返回元素的最大高度。

maxHeight 屬性只在塊級(jí)元素或絕對(duì)/固定位置的元素發(fā)揮作用。

注意:一個(gè)元素的高度永遠(yuǎn)不能大于 maxHeight 屬性規(guī)定的值。

語(yǔ)法

設(shè)置 maxHeight 屬性:

Object.style.maxHeight="none|length|%|inherit"

返回 maxHeight 屬性:

Object.style.maxHeight

描述
none 默認(rèn)。元素的高度沒(méi)有限制。
length 使用 px、cm 等單位定義最大高度。
% 定義最大高度為父元素的百分比。
inherit maxHeight 屬性的值從父元素繼承。


瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主要瀏覽器都支持 maxHeight 屬性。

注意:IE7 及更早的版本不支持 "inherit" 值。IE8 只有規(guī)定了 !DOCTYPE 才支持 "inherit"。IE9 支持 "inherit"。


實(shí)例

實(shí)例

設(shè)置元素的最大高度:

<html>
<head>
<script>
function displayResult()
{
document.getElementById("p1").style.maxHeight="15px";
}
</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="displayResult()" value="Set max height">

</body>
</html>

嘗試一下 ?


Style 對(duì)象參考手冊(cè) Style 對(duì)象
以上內(nèi)容是否對(duì)您有幫助:
在線(xiàn)筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)