我希望我的卡片覆盖相同宽度的屏幕,但下面的代码是根据内容编写的。
尝试牌组,但无济于事。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/css/all.min.css" rel="stylesheet">
</head>
<body>
<div class="container p-3 bg-white rounded">
<div class="row">
<div id="carouselExampleIndicators" class="carousel slide carousel-fade" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<div class="row">
<div class="col-lg-3">
<div class="card text-white bg-primary">
<div class="card-body">
<h5 class="card-title">0-10</h5>
<p class="card-text">00</p>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card text-white bg-primary">
<div class="card-body">
<h5 class="card-title">1-9</h5>
<p class="card-text">00</p>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card text-white bg-primary">
<div class="card-body">
<h5 class="card-title">2-8</h5>
<p class="card-text">00</p>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card text-white bg-primary">
<div class="card-body">
<h5 class="card-title">3-7</h5>
<p class="card-text">00</p>
</div>
</div>
</div>
</div>
</div>
<div class="carousel-item ">
<div class="row">
<div class="col-lg-3">
<div class="card text-white bg-primary">
<div class="card-body">
<h5 class="card-title">4-6</h5>
<p class="card-text">00</p>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card text-white bg-primary">
<div class="card-body">
<h5 class="card-title">5-5</h5>
<p class="card-text">00</p>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card text-white bg-primary">
<div class="card-body">
<h5 class="card-title">6-4</h5>
<p class="card-text">00</p>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card text-white bg-primary">
<div class="card-body">
<h5 class="card-title">7-3</h5>
<p class="card-text">00</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
我希望我的卡片覆盖相同宽度的屏幕,但我下面的代码是根据内容的。
尝试牌组,但无济于事。
我希望我的卡片覆盖相同宽度的屏幕,但我下面的代码是根据内容的。
尝试牌组,但无济于事。
在div块中,将col-lg-3
更改为col-lg-auto
,使其在屏幕上占据相等的宽度
尝试使用这样的.card列类:
<div class="card-columns">
<div id="card1" class="card">
<img class="card-img-top" src="" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">
CARD 1 TITLE
</h5>
</div>
<div class="card-body">
CARD 1 BODY
</div>
</div>
<div id="card2" class="card">
<img class="card-img-top" src="" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">
CARD 2 TITLE
</h5>
</div>
<div class="card-body">
CARD 2 BODY
</div>
</div>
</div>
并删除行和列div,卡列类负责其余