設定帶標題的 Bootstrap 面板


按照以下步驟將 Bootstrap 面板與標題一起設定:-

  • 使用 .panel-heading 類將標題容器新增到面板。
  • 使用任何 <h1>-<h6> 和 .panel-title 類來新增預設樣式標題。

嘗試執行以下程式碼以便 Bootstrap 中的標題帶有面板,-

示例

即時演示

<!DOCTYPE html>
<html>
   <head>
      <title>Bootstrap Example</title>
      <link href = "/bootstrap/css/bootstrap.min.css" rel = "stylesheet">
      <script src = "/scripts/jquery.min.js"></script>
      <script src = "/bootstrap/js/bootstrap.min.js"></script>
   </head>
   <body>
      <div class = "panel panel-default">
         <div class = "panel-heading">
            Tutorials
         </div>
         <div class = "panel-body">
            Learn for free
         </div>
      </div>
         
      <div class = "panel panel-default">
         <div class = "panel-heading">
            <h3 class = "panel-title">
               Quiz
            </h3>
         </div>
               
         <div class = "panel-body">
            Attempt these quizzes
         </div>
      </div>
   </body>
</html>

更新於: 2020 年 6 月 12 日

228 次瀏覽

開啟你的 職業

完成課程並獲得認證

開始
廣告