要在Bootstrap中创建卡,请使用.card类并添加卡主体-
<div class="card"> <div class="card-body">Basic card</div> </div>
您还可以分别使用card-title和card-title类设置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://cdn.staticfile.org/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"> <h2>Demo Card</h2> <div class="card"> <div class="card-body">This is the body of the card.</div> </div> </div> </body> </html>