padding-inline-start property
The padding-inline-start property specifies
the start padding of an element along the
inline (horizontal) axis.
Syntax
selector {
padding-inline-start: size;
}
Example
Let's set the inline-axis starting padding
of the child element to 20px:
<div>
<p>text</p>
</div>
div {
width: 400px;
height: 200px;
border: 1px solid black;
}
p {
padding-inline-start: 20px;
width: 100px;
height: 50px;
border: 1px solid red;
}
:
Example
Now let's set the start padding of the
child element on the inline axis
to 20%:
<div>
<p>text</p>
</div>
div {
width: 400px;
height: 200px;
border: 1px solid black;
}
p {
padding-inline-start: 20%;
width: 100px;
height: 50px;
border: 1px solid red;
}
:
See also
-
the
padding-inline-endproperty
that specifies the end padding of an element along the inline axis -
the
padding-block-endproperty
that specifies the end padding of an element along the block axis -
the
padding-block-startproperty
that specifies the start padding of an element along the block axis -
the
paddingproperty
that sets a padding -
the
margin-bottomproperty
that sets a bottom margin -
the
margin-leftproperty
that sets a left margin -
the
margin-rightproperty
that sets a right margin -
the
marginproperty
that is a shorthand for a margin