源代码 -->
左右布局
AI 编程工具
点击运行
<!DOCTYPE html> <html> <head> <title>Bootstrap5 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.staticfile.net/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.staticfile.net/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script> </head> <body> <div class="container mt-3"> <h2>图片对齐方式</h2> <p>使用 .float-start 类来设置图片左对齐,使用 .float-end 类设置图片右对齐:</p> <img src="paris.jpg" class="float-start" alt="Paris" width="304" height="236"> <img src="paris.jpg" class="float-end" alt="Paris" width="304" height="236"> </div> </body> </html>
运行结果