使用 bg-info 類設定 Bootstrap 卡片樣式


在 Bootstrap 4 中將 bg-info 類與 card 類一起使用,以便在卡片中新增資訊-

<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 類與 card 類一起使用-

示例

即時演示

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

更新於: 2020 年 6 月 18 日

瀏覽量:172

開啟你的 職業生涯

完成課程,獲取認證

入門
廣告
© . All rights reserved.