欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

HTML DOM left 屬性

HTML DOM Style 對(duì)象

定義和用法

left 屬性設(shè)置定位元素左外邊距邊界與其包含塊左邊界之間的偏移。

語(yǔ)法:

Object.style.left=auto|%|length

可能的值

描述
auto 默認(rèn)。通過(guò)瀏覽器來(lái)計(jì)算左側(cè)的位置。
% 設(shè)置元素的左邊到最近一個(gè)具有定位設(shè)置父元素的左邊緣的百分比位置。
length 使用 px、cm 等單位設(shè)置元素的左邊到最近一個(gè)具有定位設(shè)置父元素的左邊緣的位置?墒褂秘(fù)值。

提示和注釋

注釋:如果 "position" 屬性的值為 "static",那么設(shè)置 "left" 屬性不會(huì)產(chǎn)生任何效果。

實(shí)例

下面的例子對(duì)按鈕的左邊進(jìn)行設(shè)置:

<html>
<head>
<style type="text/css">
input
{
position:absolute;
}
</style>
<script type="text/javascript">
function setLeftEdge()
{
document.getElementById("b1").style.left="100px";
}
</script>
</head>
<body>

<input type="button" id="b1" onclick="setLeftEdge()"
value="Set left edge to 100 px" />

</body>
</html>

HTML DOM Style 對(duì)象