You are here: Reference > JavaScript > client-side > HTML DOM > properties > bottomMargin (body)

bottomMargin property (body)

Browser support:
Specifies or returns the thickness of the bottom margin in the document body.
This property is deprecated. Use the marginBottom style property instead.

Syntax:

object.bottomMargin;
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: bottomMargin

Possible values:

String that sets or retrieves the thickness of the bottom margin with an integer, optionally follwed by 'px' (pixel) unit designator.
Default: 15.

Example HTML code 1:

This example illustrates the use of the bottomMargin attribute:
<body bottommargin="130">
    There is a 130px tall space at the bottom of the document.
    <div style="height:400px; background:green;">Go to the bottom of the page!</div>
</body>
Did you find this example helpful? yes no

Example HTML code 2:

Recommendation:
<body style="margin-bottom:130px">
    There is a 130px tall space at the bottom of the document.
    <div style="height:400px; background:green;">Go to the bottom of the page!</div>
</body>
Did you find this example helpful? yes no

Example HTML code 3:

This example illustrates the use of the bottomMargin property:
<head>
    <script type="text/javascript">
        function SetBottomMargin () {
            input = document.getElementById ("myInput");

            if ('bottomMargin' in document.body) {
                document.body.bottomMargin = input.value;
            } else {
                alert ("Your browser doesn't support this example!");
            }
        }
    </script>
</head>
<body bottommargin="130">
    There is a 130px tall space at the bottom of the document.
    <div style="height:400px; background:green;">Go to the bottom of the page!</div>

    <input id="myInput" type="text" value="200" />
    <button onclick="SetBottomMargin ();">Set bottomMargin!</button>
</body>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content