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>

更新於: 18-Jun-2020

272 次檢視

開啟你的 職業生涯

完成課程即可獲得認證

開始
廣告
© . All rights reserved.