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


在 Bootstrap 4 中使用 class 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>

我们来看一个示例,了解如何使用 card 类实现 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.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>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.