Latest

recent

CSS margin-top Property

Definition

The margin-top property sets the top margin of an element.
Note: Negative values are allowed.
Inherited: No

JavaScript Syntax

CSS properties can also be dynamically changed with a JavaScript.
Scripting Syntax: object.style.marginTop="10px"

Example

h1
{
margin-top: 10px
}
h2
{
margin-top: -20px
}

Possible Values

Value Description
auto The browser sets a top margin
length Defines a fixed top margin. Default value is 0
% Defines a top margin in % of the total height of the document

Goto CSS3 and CSS2 complete reference
CSS margin-top Property Reviewed by 1000sourcecodes on 21:21 Rating: 5
Powered by Blogger.