Loading Please Wait...
CSS padding property sets transparent white space within the element. It is a space between element border and content (text, image).
padding: 10px;
padding: 5%;
padding: unset;
CSS padding property can have following values:
Length values: px, cm, rem, em, etc.
Percentage values: 5%, 10%, etc.
Zero value: 0px, 0%, 0. It is best practice not to use any length or percentage value when defining 0 padding.
Global value: inherit, initial, revert, revert-layer, unset.
Sets padding for all sides
padding: 10px;
First value sets padding of top-bottom and second value sets padding of left-right
padding: 10px 0.5rem;
First value sets padding of top, second value sets padding of left-right and third value sets padding of bottom
padding: 10px 0.5rem 5%;
First value sets padding of top, second value sets padding of right, third value sets padding of bottom, and forth value sets padding of left.
padding: 10px 0.5rem 5% auto;
/* Apply to all four sides */
padding : 1em;
/* top and bottom | left and right */
padding: 5% 10px;
/* top | left and right | bottom */
padding: 1em 20px 2em;
/* top | right | bottom | left */
padding: 2px 1em 0 20px;
/* Global values */
padding: inherit;
padding: initial;
padding: revert;
padding: revert-layer;
padding: unset;
CSS provide padding-top, padding-right, padding-bottom, padding-left property to set padding of individual sides.
/* top padding */
padding-top: 10px;
/* right padding */
padding-right: 0;
/* bottom padding */
padding-bottom: 5%;
/* left padding */
padding-left: inherit;
How you feel about this blog:
Share this blog on:
If you find any error in the turtorials, or want to share your suggestion/feedback, feel free to send us email at: info@lynxsia.com
Contact UsWe are concern with various development process like website design & development, E-commerce development, Software development, Application development, SMS & Bulk SMS Provider, PWA Development, and many more..
Copyright ©
, Lynxsia IT Solutions, All rights reserved