如何在 Bootstrap 中使用 Glyphicons 圖示


若要在 Bootstrap 中使用 Glyphicons 圖示,只需在程式碼中幾乎任何地方使用以下程式碼即可。為了適當填充,請在圖示和文字之間留一個空格,如下所示 −

示例

線上演示

<!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>
      <span class = "glyphicon glyphicon-user"></span>
   </body>
</html>

您可以嘗試執行以下程式碼以實現 Glyphicons 圖示

示例

線上演示

<!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>
      <p>The following are the icons:</p>
      <p>
         <button type = "button" class = "btn btn-default">
            <span class = "glyphicon glyphicon-print"></span>
         </button>
         <button type = "button" class = "btn btn-default">
            <span class = "glyphicon glyphicon-search"></span>
         </button>
         <button type = "button" class = "btn btn-default">
            <span class = "glyphicon glyphicon-download"></span>
         </button>
      </p>
   </body>
</html>

更新日期:12-6-2020

1 千多次訪問

開啟您的 事業

完成課程獲得認證

開始
廣告