搜索文档
首页
HTML/CSS
JavaScript
服务端开发
Java教程
移动端
数据库
当前位置:
首页
HTML/CSS
Bootstrap4 教程
Bootstrap4 基础教程
源代码
清空
点击运行
<!DOCTYPE html> <html> <head> <title>Bootstrap 示例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css"> <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script> <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h2>图片对齐方式</h2> <p>使用 .float-right 类来设置图片右对齐,使用 .float-left 类设置图片左对齐:</p> <img src="https://www.div.cn/run/images/paris.jpg" class="float-left"> <img src="https://www.div.cn/run/images/cinqueterre.jpg" class="float-right"> </div> </body> </html>
运行结果