CSS Basic Tutorial
CSS Flexbox
In CSS, the padding
property is used to control the space inside an element, between the content and the element's border. Padding helps create breathing room around an element's content.
padding: <value>;
Value: Can be a length (e.g., px
, em
, %
), or keywords like inherit
.
You can specify padding for each side of the element individually using these properties:
padding-top
padding-right
padding-bottom
padding-left
Try it yourself
Like margin
, padding also has shorthand for setting different values for the sides in one declaration:
padding: <top> <right> <bottom> <left>;