CSS Margin Top Property
Last Updated Jul 21, 2015, 12:00:06 PM
CSS Margin Top
The CSS margin-top property sets the margin space required on the top of an element
A negative value is also allowed.
SyntaxDefinition and Usage
Initial Value | 0 |
Applies to | all elements. It also applies to ::first-letter and ::first-line . |
Inherited | no |
Percentages | refer to the width of the containing block |
Media | Visual |
Computed Value | the percentage as specified or the absolute length |
Animatable | Yes, as a length |
Canonical Order | The unique non-ambiguous order defined by the formal grammer |
Example1
Watch GIF Try It NowExample2
Try It NowBrowser compatibility
Feature | |||||||
---|---|---|---|---|---|---|---|
Basic support | 1.0 | 1.0 (1.7 or earlier) | 1.0 | 3.5 | 3.0 | 1.0 | 1.0 |
Other Advanced CSS Margin Properties you might want to Learn
CSS margin-right propertyCSS margin-left property
CSS margin-bottom property
Sources and Credits
The source of the content has been referred and updated with Mozilla Foundation and W3C Organization
Last Updated Jul 21, 2015, 12:00:06 PM