document.classes.marginTop

JavaScript 1.2+ Nav4+ Syntax

document.classes.className.tagName.marginTop

Description

The marginTop property specifies the distance between the top border of an element and the bottom border of another element. Dot notation is used to associate this property with the class called className. The definition can also specify a tag or the word all for tagName.

Example

Listing 7.83 uses marginTop property to set the distance between adjacent elements.

Listing 7.83 Set the Top Margin with the marginTop Property
 <html> <script> <!-- Hide //Create a style sheet class that defines top margin document.classes.FORMAT.all.borderWidths(10); document.classes.FORMAT.all.marginTop = 40; //Hide End ---> </script> <b>My ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.