CSS margin-top property

Description

It is a longhand property that represents margin area above the top border of the box i.e. the influencing range above the box.

Syntax

margin-top : length

Property values

lengthDefault

100-100

There is no thickness of the margin area on the top side of the border box.

margin-top: 0;

+ve length

1000

There is 20px space on the top side of the box.

margin-top: 20px;

-ve length

0-100

The space on the top side of the border decreases by 20px i.e. it may move upwards.

margin-top: -20px;

Applicable to

It applies to all elements

#CSS digger
Was this article helpful?

 
It is a longhand property that represents margin area above the top border of the box i.e. the influencing range above the box.
margin-top: 0;
×

Ctrl+D