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

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

margin-top: 0;

+ve length

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

margin-top: 20px;

-ve length

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.
×

Ctrl+D