源代码 :
点击运行
<!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 mt-3"> <h2>行内 Flex</h2> <p>根据不同的屏幕设备创建行内弹性盒子容器, d-*-inline-flex 类可以控制弹性元素的布局。</p> <p>重置浏览器查看效果。</p> <div class="d-inline-flex bg-success">d-flex</div> <div class="d-sm-inline-flex bg-success">d-sm-flex</div> <div class="d-md-inline-flex bg-success">d-md-flex</div> <div class="d-lg-inline-flex bg-success">d-lg-flex</div> <div class="d-xl-inline-flex bg-success">d-xl-flex</div> </div> </body> </html>
运行结果