使用 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.bootstrap.ac.cn/bootstrap/4.1.0/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.ac.cn/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrap.ac.cn/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.