中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Style bottom 屬性

Style 對象參考手冊 Style 對象

定義和用法

bottom 屬性設(shè)置或返回定位元素的底部位置。

該屬性規(guī)定了元素的底部位置,包括:內(nèi)邊距、滾動條、邊框和外邊距。

提示:一個定位元素是元素的 position 屬性被設(shè)置為:relative(相對)、absolute(絕對)或 fixed(固定)。

語法

設(shè)置 bottom 屬性:

Object.style.bottom="auto|length|%|inherit"

返回 bottom 屬性:

Object.style.bottom
描述
auto 默認。通過瀏覽器計算底部的位置。
length 使用 px、cm 等單位設(shè)置元素的底邊到最近一個具有定位設(shè)置父元素的底部邊緣的位置??墒褂秘撝?。
% 設(shè)置元素的底邊到最近一個具有定位設(shè)置父元素的底部邊緣的百分比位置。
inherit bottom 屬性的值從父元素繼承。

瀏覽器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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

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


實例

實例

設(shè)置按鈕的底部位置:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>小白教程(json.cn)</title>
<style type="text/css">
#b1{
????position:absolute;
}
</style>
<script>
function displayResult(){
????document.getElementById("b1").style.bottom="100px";
}
</script>
</head>
<body>

<input type="button" id="b1" onclick="displayResult()" value="設(shè)置底部的位置">

</body>
</html>

運行代碼 ?

Style 對象參考手冊 Style 對象其他擴展