Bootstrap .card 類


要在 Bootstrap 中建立卡片,請使用 .card 類並新增卡片主體 −

<div class="card">
  <div class="card-body">Basic card</div>
</div>

你還可以分別使用 card-title 和 card-title 類設定 Bootstrap 卡片標題和卡片頁尾。

以下是建立 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">
   <h2>Demo Card</h2>
   <div class="card">
     <div class="card-body">This is the body of the card.</div>
   </div>
</div>

</body>
</html>

更新於:2020 年 6 月 18 日

272 次瀏覽

啟動 事業

完成課程以獲取認證

開始
廣告
© . All rights reserved.