源代码:
下载代码
AI 编程工具
点击运行
<!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.net/twitter-bootstrap/4.3.1/css/bootstrap.min.css"> <script src="https://cdn.staticfile.net/jquery/3.2.1/jquery.min.js"></script> <script src="https://cdn.staticfile.net/popper.js/1.15.0/umd/popper.min.js"></script> <script src="https://cdn.staticfile.net/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script> </head> <body> <div class="container mt-3"> <h1>边距工具</h1> <p>元素边距类格式为 {property}{sides}-{breakpoint}-{size}。 </p> <p>如果您希望填充或边距适用于所有屏幕尺寸,请省略断点 breakpoint。 </p> <div class="pt-4 bg-warning">只设置 top padding (1.5rem)</div> <div class="p-5 bg-success">所有边设置 padding (3rem)</div> <div class="m-5 pb-5 bg-info">所有边设置 margin (3rem) 以及一个 bottom padding (3rem)</div> </div> </body> </html>
运行结果: