W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html lang="en"> <head> <title>Bootstrap 实例</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/css/bootstrap.min.css" rel="stylesheet"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.2/dist/js/bootstrap.bundle.min.js"></script> </head> <body> <div class="container mt-3"> <h1>间距 Utility</h1> <p>使用 {property. {Sides} - {breakpoint} - {size} 类设置元素的间距。如果您希望填充或边距适用于所有屏幕尺寸,请省略断点。</p> <div class="pt-4 bg-warning">我只有上内边距 (1.5rem)</div> <div class="p-5 bg-success">我在所有边都有内边距 (3rem)</div> <div class="m-5 pb-5 bg-info">我在所有边都有外边距 (3rem) 和下内边距 (3rem)</div> </div> </body> </html>