如何在 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 千多次访问

开启您的 事业

完成课程获得认证

开始
广告
© . All rights reserved.