使用 Bootstrap 4 卡片添加信息

bootstrapweb developmentcss framework更新于 2024/1/14 14:04:17

要在 Bootstrap 4 中向卡片添加信息,请使用 bg-info 类。

将 card 类与 bg-info 类一起使用:

<div class="card bg-info">

之后使用 card-body 类添加卡片主体 −

<div class="card-body">
  演示文本
</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>

相关文章