CSS CSS Tutorial CSS Advanced CSS Responsive Web Design(RWD) CSS Grid CSS Properties Sass Tutorial Sass Functions



padding-inline

Padding-Inline is a CSS property that is used to add space between the content and the inline edges of an element. It is a shorthand property that combines the padding-left and padding-right properties into a single property. Padding-Inline is used to add space between the content and the left and right edges of an element.

The padding-inline property is used to add space between the content and the inline edges of an element. The inline edges are the left and right edges of an element. The padding-inline property is a shorthand property that combines the padding-left and padding-right properties into a single property. The padding-inline property is used to add space between the content and the left and right edges of an element.

The padding-inline property can be used with any HTML element. It is commonly used with text elements such as paragraphs, headings, and lists. The padding-inline property can also be used with images and other inline elements.

Code Examples

The following code examples demonstrate how to use the padding-inline property in CSS:

Example 1:

    
        p {
            padding-inline: 20px;
        }
    

This code sets the padding on the left and right sides of the paragraph to 20 pixels.

Example 2:

    
        h1 {
            padding-inline: 10px 20px;
        }
    

This code sets the padding on the left side of the heading to 10 pixels and the padding on the right side of the heading to 20 pixels.

Example 3:

    
        ul {
            padding-inline: 0 10px;
        }
    

This code sets the padding on the left side of the unordered list to 0 pixels and the padding on the right side of the unordered list to 10 pixels.

Example 4:

    
        img {
            padding-inline: 5px;
        }
    

This code sets the padding on the left and right sides of the image to 5 pixels.

Conclusion

The padding-inline property is a useful CSS property that is used to add space between the content and the inline edges of an element. It is commonly used with text elements such as paragraphs, headings, and lists. The padding-inline property can also be used with images and other inline elements. By using the padding-inline property, you can easily add space between the content and the left and right edges of an element.

References

Activity