使用 bg-info 类设置 Bootstrap 卡片样式

bootstrapweb developmentcss framework更新于 2024/2/2 18:20:17

在 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>

让我们看一个例子来学习如何使用卡片类实现 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://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>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>

相关文章