在Bootstrap 4中将bg-info类与card-class一起使用以在卡中添加信息-
<div class="card bg-info text-white">
现在在其中包含card-body类-
<div class="card bg-info text-white"> <div class="card-body"> Bring your Laptop for the BootCamp </div> </div>
让我们看一个示例,以学习如何使用card类实现Bootstrap 4 bg-info类-
<!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>Information - Event</h3> <div class="card bg-info text-white"> <div class="card-body">Bring your Laptop for the BootCamp</div> </div> </div> </body> </html>