使用 Bootstrap 4 卡片新增資訊


要在 Bootstrap 4 中向卡片新增資訊,請使用 bg-info 類。

結合 bg-info 類使用 card 類

<div class="card bg-info">

使用 card-body 類,在之後新增卡片正文 -

<div class="card-body">
  Demo Text
</div>

你可以嘗試執行以下程式碼來新增資訊 -

示例

線上演示

<!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>Festival Celebration</h3>
  <div class="card bg-info text-white">
    <div class="card-body">Reach till 5PM</div>
  </div>
</div>

</body>
</html>

更新於: 2020-06-17

92 次觀看

開啟你的 職業生涯

透過完成課程獲得認證

立即開始
廣告