Search code examples
htmlcssbootstrap-4frontendbootstrap-modal

How to do padding left in bootstrap5?


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

Solution

  • 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>