How to do padding left in bootstrap5?

Viewed 5120

In bootstrap4 we've used pl-5 for padding left, in bootstrap5 it is not working.

<div class="col-md-6 col-9 p-3 pl-5"> in bootstrap5 this code is not working
2 Answers

According to the documentation the class names are ps- or pe- ... meaning start / end rather than left or right.

The reason is, that if you switch from RTL to LTR site your padding would still be applied from the correct side.

<div class="ps-2">I have a padding left on LTR and a padding right on RTL languages</div>

In bootstrap-5 pl and pr is replaced ps and pe respectively.

`

  <div className="col-md-4 pt-5 ps-3" style={colBorder}>Lorem ipsum dolor sit 


                         amet consectetur adipisicing elit. Quasi, sed!</div>


  <div className="col-md-4 pb-5 pe-5" style={colBorder2}>Lorem ipsum dolor sit 


                         amet consectetur adipisicing elit. Quasi, sed!</div>


</div>
`
Related