使用 bg-warning 類對 Bootstrap 4 卡片進行樣式化


在 Bootstrap 中使用 bg-warning 類和 card 類,可以在 Bootstrap 卡片上設定警告 操作。

設定警告訊息如下 −

Do not cross!
High Voltage!

使用以下程式碼對 Bootstrap 卡片進行樣式化 −

<div class="card bg-warning">
  <div class="card-body">You are trespassing on private property!</div>
</div>

可以嘗試執行以下程式碼,使用 bg-warning 類對 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://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>Warning</h3>
    <div class="card bg-warning">
      <div class="card-body">You are trespassing on private property!</div>
    </div>
  </div>
</body>
</html>

更新於: 2020 年 6 月 18 日

339 次瀏覽

啟動你的職業

完成課程即可獲得認證

開始
廣告
© . All rights reserved.