ScanSkill

margin-top

The margin-top property sets the margin at the top of the element.

Syntax

margin-top: value | auto;

Example

.mydiv{
 margin-top: 20px;
 background-color: red;
}
margin-top

Property Values

value: sets the provided value as the margin to the top of an element.

auto: automatically sets the margin to the top of an element.