| margin-top |
| The margin is what is used to set the box size around the element. It is the area between the border to the edge of the box.
margin-top This property is used to specify the top margin area of an element's box. This area is transparent, and will display the background color of the document. margin-top values length The length measurement options for this value are: • mm millimeters. • cm centimeters. • in inches. • pt points, which is a way of measuring the font size. One point is 1/72 (one seventy-second) of an inch. • pc picas, which is yet another way of measuring font size. One pica is equal to 12 points. • px pixels, which is one screen element. The display you're looking at is comprised of thousands of individual dots, each of which can change in color and luminosity to achieve the desired image. Each of these dots is referred to as a pixel. • ex x-height settings, which is the height of the font's lower case letter 'x'. • em em setting. One em is equivalent to the width of a capital letter in the chosen font. Millimeters, centimeters, inches, points, and picas are considered to be absolute lengths because you're specifying the exact size of the value. Relative units such as em and ex are interpreted as references to the parent font size. Percentage This value sets the length for the distance between the border and the edge of the box as a percentage of that element's total size. auto This value will automatically set the top margin to the browser's default setting. EXAMPLE: P {margin-top: 10px} This example will set the margin along the top of the element to a width of 10 pixels. P {margin-top: 1.5cm} This example will set the top margin of the heading level P to a width of 1.5 cm. P {margin-top: 10%} This example will set the width of the top margin to 10 percent of the element width. |