CSS | padding-right Property
Padding is the space between its content and its border. The padding-right property in CSS is used to set the width of the padding area on the right of an element.
Syntax:
padding-right: 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-right: length;
Example:
<!DOCTYPE html><html><head><title>padding-right Property</title><style>.geek {padding-right: 200px;color: white;background: green;width:50%;font-size:18px;}</style></head><bodystyle="text-align:center"><h1style="color: green;">GeeksforGeeks</h1><h2>padding-right Property</h2><!-- padding property used here --><pclass="geek">This paragraph has a padding-right: 200px;</p></body></html>chevron_rightfilter_noneOutput:
- percentage: This mode is used to set the right padding in percent of the width of the element. It must be non-negative.
Syntax:
padding-right: percentage;
Example:
<!DOCTYPE html><html><head><title>padding-right Property</title><style>.geek {padding-right: 40%;color: white;background: green;width:50%;font-size:18px;}</style></head><bodystyle="text-align:center"><h1style="color: green;">GeeksforGeeks</h1><h2>padding-right Property</h2><!-- padding property used here --><pclass="geek">This paragraph has a padding-right: 40%;</p></body></html>chevron_rightfilter_noneOutput:
- initial: This property is used to set the default value.
Syntax:
padding-right: initial;
Example:
<!DOCTYPE html><html><head><title>padding-right Property</title><style>.geek {padding-right: initial;color: white;background: green;width:70%;font-size:25px;}</style></head><bodystyle="text-align:center"><h1style="color: green;">GeeksforGeeks</h1><h2>padding-right Property</h2><!-- padding property used here --><pclass="geek">This paragraph has a padding-right: initial;</p></body></html>chevron_rightfilter_noneOutput:
Supported Browsers: The browser supported by padding-right 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 paddingRight Property
- CSS | transition-property Property
- CSS | top Property
- CSS | nav-down property
- CSS | right Property
- CSS | nav-right property
- CSS | all Property
- CSS | perspective Property
- CSS overflow-y Property
- CSS | transition Property
- CSS | flex Property
- CSS | resize Property
- CSS | align-self Property
- CSS | grid-row Property
- CSS | grid-gap 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.



