CSS paddingright Property (original) (raw)

CSS padding-right Property

Last Updated : 28 May, 2026

The padding-right property in CSS is used to add space between the content and the right border of an element. It helps improve spacing and alignment within webpage elements.

**Syntax:

padding-right: length | percentage | initial | inherit;

**Property values:

**Example: Here, we use padding-right: length; property.

html `

padding-right Property
<style>
    .geek {
        padding-right: 200px;
        color: white;
        background: green;
        width: 50%;
        font-size: 18px;
    }
</style>

GeeksforGeeks

<h2>
    padding-right Property
</h2>

<!-- padding-right property used here -->
<p class="geek">
    This paragraph has a padding-right: 200px;
</p>

`

**Example: Here, we are using padding-right: percentage; property.

html `

padding-right Property
<style>
    .geek {
        padding-right: 40%;
        color: white;
        background: green;
        width: 50%;
        font-size: 18px;
    }
</style>

GeeksforGeeks

padding-right Property

<!-- padding-right property used here -->
<p class="geek">
    This paragraph has a padding-right: 40%;
</p>

`

**Example: Here, we are using padding-right: initial; property.

html `

padding-right Property
<style>
    .geek {
        padding-right: initial;
        color: white;
        background: green;
        width: 70%;
        font-size: 25px;
    }
</style>

GeeksforGeeks

<h2>
    padding-right Property
</h2>

<!-- padding-right property used here -->
<p class="geek">
    This paragraph has a padding-right: initial;
</p>

`