Heim > Fragen und Antworten > Hauptteil
P粉4706452222023-08-17 09:50:10
要使用CSS增加行中的列间距,可以使用grid-column-gap属性。该属性指定了网格布局中列之间的间距。
.container { mt-5; pt-5; } .row { text-light; g-5; fs-1; grid-column-gap: 50px; }
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> <div class="container mt-5 pt-5"> <div class="row text-light g-5 fs-1"> <div class="col-lg-4"> <div class="bg-dark p-5">column</div> </div> <div class="col-lg-4"> <div class="bg-dark p-5">column</div> </div> <div class="col-lg-4"> <div class="bg-dark p-5">column</div> </div> </div> </div>