boostrap預約義樣式風格

  1. 預約義樣式分爲五種:primary(首選項)、success(成功)、info(通常信息)、warning(警告)、danger(危險),demo以下,設置不一樣的class展現不一樣的樣式
    • <!DOCTYPE HTML>
      <html>
          <head>
              <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
              <title>無標題文檔</title>
              <meta http-equiv="X-UA-Compatible" content="IE=edge">
              <meta name="viewport" content="width=device-width, initial-scale=1">
              <link rel="stylesheet" href="css/bootstrap.css">
              <style>
                  .glyphicon-heart {font-size: 100px; color: red;}
              </style>
          </head>
      <body>
      
      <div class="container">
          <input type="button" value="默認樣式" />
          <input type="button" class="btn btn-primary" value="首選項" />
          <input type="button" class="btn btn-success" value="成功" />
          <input type="button" class="btn btn-info" value="通常信息" />
          <input type="button" class="btn btn-warning" value="警告" />
          <input type="button" class="btn btn-danger" value="危險" />
      
      </div>
      
      </body>
          <script src="js/jquery-2.1.3.js"></script>
          <script src="js/bootstrap.js"></script>
      </html>
      View Code

    • 除了上述的btn-*外還有其餘的一些class,好比(bg | text | alert)-(primary | success | info | warning | danger)等,可分別設置不一樣的樣式
  2. 以下是一個面板控件
    • 網址:http://v3.bootcss.com/components/#panels
    • 一個面板的小demo代碼以及效果圖以下
      <!DOCTYPE HTML>
      <html>
          <head>
              <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
              <title>無標題文檔</title>
              <meta http-equiv="X-UA-Compatible" content="IE=edge">
              <meta name="viewport" content="width=device-width, initial-scale=1">
              <link rel="stylesheet" href="css/bootstrap.css">
              <style>
                  .glyphicon-heart {font-size: 100px; color: red;}
              </style>
          </head>
      <body>
      
      <div class="container">
          <div class="panel panel-primary">
              <div class="panel-heading">
                  <h3>我是面板的標題</h3>
              </div>
              <div class="panel-body">
                  我是面板的主體內容
              </div>
          </div>
      </div>
      
      </body>
          <script src="js/jquery-2.1.3.js"></script>
          <script src="js/bootstrap.js"></script>
      </html>
      View Code

相關文章
相關標籤/搜索