The CSS padding properties are the main purpose to used generate (or maintain) the space around an element’s content, inside of any defined borders.
finally, with CSS padding properties allow you to set how much space should appear between the content of an element and its defined border.
therefore, there CSS padding properties are setting the padding for each side of an element (such as top, bottom, left, and right) so that you have full control over, as a result, the padding you can also set different values for the padding on each side of the box.
Therefore, the padding value should be either a length (px, cm, etc.), a percentage (%), or the word inherit. If the value is inherited.
In CSS Indivisiul Padding Sides
as a result, The CSS properties can be used to control lists. therefore, You are free to set different values for the padding on every side of the box using the following properties:- the indivisible padding side name given below Padding
therefore, in padding properties, the padding serves as shorthand for the preceding properties and value provided as a single value (such as padding: 15px, the value in pixels) Padding-Top Padding-Right Padding-Bottom Padding-Left The following padding properties values provide as given below:- length:- As a result, The padding value will be specified in px, pt, cm, etc. Percentage(%):- The padding value will be specified width (%) of the width of the containing element inherit:- therefore, padding value specifies that the padding should be inherited from the parent element
let us see all cases, these padding properties can have from one to four values case -I: the padding property has four values:
* the top padding is 15px * the right padding is 10px * the bottom padding is 12px * the left padding is 20px
Case-II: the padding property has three values respectively:
* top padding is 15px * therefore, right and left padding is 10px * as a result bottom padding is 5px Case-III: the padding property has two values:
*top and bottom padding are 15px *right and left padding are 10px
Case-IV: the padding property has one value:
therefore, all four paddings (top, right, bottom, left) are 20px