要在Bootstrap卡中的标题后设置字幕,请使用卡字幕类。
让我们看看如何-
<h6 class="card-subtitle text-muted"> Set Subtitle here </h6>
在card-title类之后和card-body类内部添加以上内容-
<div class="card-body"> <h4 class="card-title">Sports</h4> <h6 class="card-subtitle text-muted">Indoor</h6> <p class="card-text">Squash, Dart, Chess</p> </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://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"> <h3>Indoor Sports</h3> <div class="card"> <div class="card-body"> <h4 class="card-title">Sports</h4> <h6 class="card-subtitle text-muted">Indoor</h6> <p class="card-text">Squash, Dart, Chess</p> </div> </div> </div> </body> </html>