垂直按鈕組與 Bootstrap


btn-group-vertical 類可讓一組按鈕垂直疊加顯示,而不是水平顯示。

你可以嘗試執行以下程式碼來使用垂直按鈕組

示例

即時演示

<!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 = "btn-group-vertical">
         <button type = "button" class = "btn btn-default">BCA</button>
         <button type = "button" class = "btn btn-default">B.Tech</button>
         <div class = "btn-group-vertical">
            <button type = "button" class = "btn btn-default dropdown-toggle" data-toggle = "dropdown">
               Masters
               span class = "caret"></span>
            </button>
            <ul class = "dropdown-menu">
               <li><a href = "#">MCA</a></li>
               <li><a href = "#">MBA</a></li>
               <li><a href = "#">M.Tech</a></li>
               <li><a href = "#">M.COM</a></li>
            </ul>
         </div>
      </div>
   </body>
</html>

更新於: 12-6-2020

92 次瀏覽

開啟你的 職業生涯

完成課程,獲得認證

開始吧
廣告