margin-right property

Description

It is a longhand property that represents margin area on the right side of the border box.


We are applying margin-right to the red border box.

Syntax

margin-right : length

Property values

0 length Default

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

margin-right: 0;

+ve length

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

margin-right: 20px;

-ve length

The space on the right side of the border decreases by 20px i.e. the content on the right side may merge into this box.

margin-right: -20px;

Applicable to

It applies to all elements

#CSS digger
Was this article helpful?

 
This is an inline element. This text is after the inline-block level element
×

Ctrl+D