Bootstrap 4 .card-group 类
使用 card-group 类在 Bootstrap 4 中创建一组卡片 -
<div class="card-group"> <div class="card bg-success"> <! - - One - - > </div> <div class="card bg-success"> <! - - Two - - > </div> <div class="card bg-success"> <! - - Three - - > </div> </div>
让我们在 Bootstrap 中像网格一样创建一组卡片 -
范例
<!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 rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script> </head> <body> <div class="container"> <h3>Group of Messages</h3> <div class="card-group"> <div class="card bg-success"> <div class="card-body text-center text-white"> <p class="card-text">Argentina won convincingly!</p> </div> </div> <div class="card bg-primary"> <div class="card-body text-center"> <p class="card-text">Demo Text!</p> </div> </div> <div class="card bg-warning"> <div class="card-body text-center text-white"> <p class="card-text">Do not cross!</p> </div> </div> <div class="card bg-success"> <div class="card-body text-center"> <p class="card-text">I did it!</p> </div> </div> <div class="card bg-success"> <div class="card-body text-center"> <p class="card-text">It worked!</p> </div> </div> </div> </div> </body> </html>
广告