The best CSS margin-right property Tutorial In 2024, In this tutorial you can learn Examples,Attribute definitions and instructions,Browser Support,Property Value,related articles,

CSS margin-right property

Examples

Setting the right margin of a p element:

p
{
margin-right: 2cm;
}


Attribute definitions and instructions

margin-right attribute of the element of the right margin.

Note: negative values are allowed.

Defaults: 0
inherit: no
version: CSS1
JavaScript syntax: object .style.marginRight = "10px"


Browser Support

Figures in the table represent the first browser to support the version number of the property.

属性
margin-right 1.0 6.0 1.0 1.0 3.5

Property Value

value description
auto Right outside your browser settings pitch.
length Defines a fixed right margin. The default value is 0.
% Define the percentage of the total height of the parent object on the right margin.
inherit Provisions should inherit the right margin from the parent element.


related articles

CSS tutorial: CSS Margin

CSS margin-right property
10/30