代码示例:(标识:bs_button_block_1)
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.1.2/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.1.2/js/bootstrap.min.js"></script>
</head>
<body>

<div style="padding:20px;">
  <h2>块级按钮</h2>
  <p>如需创建跨越父元素整个宽度的块级按钮,请在父元素上使用 .d-grid "helper" 类:</p>
  <div class="d-grid">
    <button type="button" class="btn btn-primary btn-block">全宽按钮</button>
  </div>
</div>

</body>
</html>
运行结果: