Style padding Property
Style padding Property
The padding property is used to either set or return the padding of an element border. It has the following types:-
- One value specifies the padding for all four sides.
- Two values will specify one padding for top and bottom paddings and the other padding for left and right paddings.
- Three values will specify the first padding for the top padding, a second padding for the left and right paddings, and a third padding for the bottom padding .
- Four values will specify the padding for all four sides from the top, right, bottom, and left sides of the margins.
Syntax:-
Its syntax is:- object.style.padding OR object.style.padding = % | length | initial | inherit
Return:-
Its return is:- string having padding of an element
Further Explanation:-
Value | Description |
---|---|
% | Defines padding in % of width of parent element. |
length | Defines padding in length units. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |