CSS | padding-left Property
Padding is the space between its content and its border. The padding-left property in CSS is used to set the width of the padding area on the left of an element.
Syntax:
padding-left: length|percentage|initial|inherit;
Property values;
- length: This mode is used to specify the size of padding as a fixed value. The default value is 0. It must be non-negative.
Syntax:
padding-left: length;
Example:
<!DOCTYPE html><html><head><title>padding-left Property</title><style>.geek {padding-left: 90px;color: white;background: green;}</style></head><body><h1style="color: green; text-align:center">GeeksforGeeks</h1><h2style="text-align:center">padding-left Property</h2><!-- padding-left property used here --><pclass="geek">This paragraph has a padding-left: 90px;</p></body></html>chevron_rightfilter_noneOutput:
- percentage: This mode is used to specify the left padding in percent of the width of the element. It must be non-negative.
Syntax:
padding-left: percentage;
Example:
<!DOCTYPE html><html><head><title>padding-left Property</title><style>.geek {padding-left: 25%;color: white;background: green;}</style></head><body><h1style="color: green; text-align:center">GeeksforGeeks</h1><h2style="text-align:center">padding-left Property</h2><!-- padding-left property used here --><pclass="geek">This paragraph has a padding-left: 25%;</p></body></html>chevron_rightfilter_noneOutput:
- initial: This property is used to set padding-left to its default value.
Syntax:padding-left: initial;
Supported Browsers: The browser supported by padding-left property are listed below:
- Google Chrome 1.0
- Internet Explorer 4.0
- Firefox 1.0
- Opera 3.5
- Apple Safari 1.0
Recommended Posts:
- HTML | DOM Style paddingLeft Property
- HTML DOM | Style paddingLeft Property
- CSS | transition-property Property
- CSS | right Property
- CSS | nav-right property
- CSS | nav-down property
- CSS | top Property
- CSS | all Property
- HTML | DOM URL Property
- CSS | column-gap Property
- HTML | DOM id Property
- CSS | hyphens Property
- Web API | DOMRect top property
- Web API | DOMRectReadOnly x property
- Web API | DOMRectReadOnly y property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



