Style marginRight Property
Style marginRight Property
The marginRight property is used to either set or return the right margin of an element. The basic purpose of margin and padding properties is to insert space around an element. However, margin inserts the space around the border while padding inserts the space within the border of an element.
Syntax:-
Its syntax is:- object.style.marginRight OR object.style.marginRight = % | length | auto | initial | inherit
Return:-
Its return is:- string having a right margin of an element
Further Explanation:-
Value | Description |
---|---|
% | Defines right margin in % of width of parent element. |
length | Defines right margin in length units. |
auto | The browser sets right margin. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |