JavaScript DHTML/Style Layout/Margin

Материал из Web эксперт
Перейти к: навигация, поиск

"bottomMargin" Example

    
<html>
<body id="myBody">
<button onclick="alert(document.body.bottomMargin);">Bottom Margin</button></body>
<button onclick="alert(document.body.topMargin);">Top Margin</button></body>
<button onclick="alert(document.body.leftMargin);">Left Margin</button></body>
<button onclick="alert(document.body.rightMargin);">Right Margin</button>
</body>
</html>



"leftMargin" Example

    
<html>
<body id="myBody">
<button onclick="alert(document.body.bottomMargin);">Bottom Margin</button></body>
<button onclick="alert(document.body.topMargin);">Top Margin</button></body>
<button onclick="alert(document.body.leftMargin);">Left Margin</button></body>
<button onclick="alert(document.body.rightMargin);">Right Margin</button>
</body>
</html>



"rightMargin" Example

    
<html>
<body id="myBody">
<button onclick="alert(document.body.bottomMargin);">Bottom Margin</button></body>
<button onclick="alert(document.body.topMargin);">Top Margin</button></body>
<button onclick="alert(document.body.leftMargin);">Left Margin</button></body>
<button onclick="alert(document.body.rightMargin);">Right Margin</button>
</body>
</html>



"topMargin" Example

    
<html>
<body id="myBody">
<button onclick="alert(document.body.bottomMargin);">Bottom Margin</button></body>
<button onclick="alert(document.body.topMargin);">Top Margin</button></body>
<button onclick="alert(document.body.leftMargin);">Left Margin</button></body>
<button onclick="alert(document.body.rightMargin);">Right Margin</button>
</body>
</html>