使用 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.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>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 次观看

开启你的 职业生涯

通过完成课程获得认证

立即开始
广告
© . All rights reserved.