Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Bootstrap 图标集


图标集

Bootstrap 提供来自 Glyphicons Halflings 集合的 260 个图标。

图标可以在文本、按钮、工具栏、导航、表单等中使用。

以下是一些图标示例

信封图标:

打印图标:

搜索图标:

下载图标:


图标语法

图标使用以下语法插入

<span class="glyphicon glyphicon-name"></span>

语法中的 name 部分必须替换为图标的正确名称。


图标示例

以下示例展示了使用图标的不同方法

示例

<p>信封图标:<span class="glyphicon glyphicon-envelope"></span></p>
<p>信封图标作为链接
  <a href="#"><span class="glyphicon glyphicon-envelope"></span></a>
</p>
<p>搜索图标:<span class="glyphicon glyphicon-search"></span></p>
<p>按钮上的搜索图标
  <button type="button" class="btn btn-default">
    <span class="glyphicon glyphicon-search"></span> 搜索
  </button>
</p>
<p>样式化按钮上的搜索图标
  <button type="button" class="btn btn-info">
    <span class="glyphicon glyphicon-search"></span> 搜索
  </button>
</p>
<p>打印图标:<span class="glyphicon glyphicon-print"></span></p>
<p>样式化链接按钮上的打印图标
  <a href="#" class="btn btn-success btn-lg">
    <span class="glyphicon glyphicon-print"></span> 打印
  </a>
</p>
自己尝试 »

用练习测试自己

练习

使用图标类值使 span 显示为 "搜索" 图标。

<span class=""></span>

开始练习


完整的 Bootstrap 图标集参考

要查看所有图标的完整参考,请访问我们的完整 Bootstrap 图标集参考


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.