1. Computing

Discuss in my forum

margin-top

By , About.com Guide

margin-top Description:

The margin-top property defines the top margin of the element.

margin-top in CSS Versions:

margin-top Syntax:

margin-top: <length> | <percentage> | auto

  • length
    A specific length (include unit of measure).
  • percentage
    A percentage of the height of the closest block-level ancestor.
  • auto
    Allows the user-agent to define the margin based on inheritance and pre-set user-agent rules.

margin-top Initial Value:

0

margin-top Applies To:

All elements.

margin-top Inheritance:

This property is not inherited.

margin-top Browser Support:

margin-top Examples:

standard margin-top

<p style="margin-top : 2em;">
 This paragraph has a 2 em margin top.
 </p>

margin-top Special Notes:

  • Negative values are permitted, but may be affected by implementation limits.

More margin-top Information:

©2013 About.com. All rights reserved.