How to align | Bootstrap align right
BootstrapisaCSSframeworkusedtodesignandcustomizeresponsive,mobile-firstsites.InBootstrap4,aligningelementstotherightcanbeachievedusinganyofthefollowingclasses:Addingfloat-rightclassThe.float-rightclassinBootstrapusestheCSSfloatpropertytoplaceanelementontheright.NotethattheBootstrap4containerisaFlexboxthatcanpreventthefloatpropertyfromworking.
Bootstrap is a CSS framework used to design and customize responsive, mobile-first sites.
In Bootstrap 4, aligning elements to the right can be achieved using any of the following classes:
Adding float-right classThe .float-right class in Bootstrap uses the CSS float property to place an element on the right. Note that the Bootstrap 4 container is a Flexbox that can prevent the float property from working.
<p class="float-right">This text is on the right</p> Enter fullscreen modeExit fullscreen mode Using justify-content-end classThe .justify-content-end class is used on Flexbox containers to align all items on the main axis to the right. Always remember that the container using this class must have its display property set to flex. This is the .d-flex class in Bootstrap 4.
<div class="justify-content-end">I am using justify-content-end</div> Enter fullscreen modeExit full...