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



padding-inline-start

Padding-Inline-Start is a CSS property that is used to add padding to the start of an inline element. It is a part of the CSS Box Model and is used to control the space between the content and the border of an element. Padding-Inline-Start is used to add space to the left side of an inline element.

The padding-inline-start property is used to set the padding of an element from the start of the inline direction. The start of the inline direction is the left side of the element in left-to-right languages like English and the right side of the element in right-to-left languages like Arabic.

The padding-inline-start property can be used with any inline element like span, a, em, strong, etc. It is a shorthand property that combines the padding-top, padding-right, padding-bottom, and padding-left properties into a single property.

The syntax for the padding-inline-start property is as follows:

selector {
  padding-inline-start: value;
}

The value of the padding-inline-start property can be specified in pixels, ems, rems, percentages, or any other valid CSS unit. The default value of the padding-inline-start property is 0.

Examples

Let's take a look at some examples of how the padding-inline-start property can be used:

Example 1: Setting Padding-Inline-Start to 20 Pixels

span {
  padding-inline-start: 20px;
}

In this example, we are setting the padding-inline-start property of the span element to 20 pixels. This will add 20 pixels of space to the left side of the span element.

Example 2: Setting Padding-Inline-Start to 10% of the Parent Element's Width

a {
  padding-inline-start: 10%;
}

In this example, we are setting the padding-inline-start property of the a element to 10% of the width of its parent element. This will add 10% of the parent element's width to the left side of the a element.

Example 3: Setting Padding-Inline-Start to 1rem

em {
  padding-inline-start: 1rem;
}

In this example, we are setting the padding-inline-start property of the em element to 1 rem. This will add 1 rem of space to the left side of the em element.

Conclusion

Padding-Inline-Start is a useful CSS property that is used to add space to the left side of an inline element. It is a shorthand property that combines the padding-top, padding-right, padding-bottom, and padding-left properties into a single property. The value of the padding-inline-start property can be specified in pixels, ems, rems, percentages, or any other valid CSS unit.

References

Activity