ShapeYourPath
(current)
Run Code
Live Code Editor- Bootstrap 4 Image Right Alignment
Source Code
<!DOCTYPE html> <html lang="en"> <head> <!-- Required meta tags --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <meta name="description" content=""> <!-- Bootstrap CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" /> <title>Bootstrap 4 Image Right Alignment</title> <style type="text/css"> img { width: 250px; height: 250px; } </style> </head> <body> <div class="container mt-4"> <h1 class="my-3">Bootstrap 4 Image Right Alignment</h1> <p class="my-3">Bootstrap 4 image can be aligned in the right direction by assigning <code>.float-right</code> to the img element base class. </p> <p class="text-justify my-3">Please keep in mind that ,float property should be cleared so that next HTML element can flow in normal.</p> <div class="row"> <div class="col-sm-12 col-12"> <img src="../code-support/images/bootstrap/bird.jpg" class="img-thumbnail float-right" alt="Thumbnail Image" /> </div> <!--/first column--> </div> <!--/row--> </div> <!--/container--> <!-- jQuery first, then Popper.js, then Bootstrap JS --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> </body> </html>
Output :
Running