使用 Bootstrap 建立表示下拉按鈕的插入符號箭頭圖示


使用 Bootstrap 中的 .caret 類建立表示下拉按鈕的插入符號箭頭圖示。

可以嘗試執行以下程式碼來建立插入符號箭頭圖示 -

示例

線上演示

<!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="container">
         <h2>Brands</h2>
         <p>The car brands:</p>
         <div class = "btn-group">
            <button type = "button" class = "btn dropdown-toggle" data-toggle = "dropdown">Car <span class="caret"></span></button>
            <ul class = "dropdown-menu" role = "menu">
               <li><a href = "#">BMW</a></li>
               <li><a href = "#">Toyota</a></li>
               <li><a href = "#">Audi</a></li>
               <li><a href = "#">Mahindra</a></li>
               <li><a href = "#">Volvo</a></li>
            </ul>
         </div>
      </div>
   </body>
</html>

更新日期:2020 年 6 月 12 日

2K+ 瀏覽次數

啟動 Career

完成課程獲得認證

入門
廣告
© . All rights reserved.