Bootstrap 图标由 Glyphicons 提供。详情可以去bootstrap官网进行查看。
用法:
<i class="icon_class_name"></i>
实例:一个搜索表单
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Example of using icons in search form - Bootstrap version 2.0</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Example of using icons in search form - Bootstrap version 2.0 from w3cschool.cc"> <meta name="author" content=""> <!-- Le styles --> <link href="../bootstrap/twitter-bootstrap-v2/docs/assets/css/bootstrap.css" rel="stylesheet"> <style type="text/css"> form { margin-top: 50px; } </style> <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <!-- Le fav and touch icons --> <link rel="shortcut icon" href="../bootstrap/twitter-bootstrap-v2/docs/examples/images/favicon.ico"> <link rel="apple-touch-icon" href="../bootstrap/twitter-bootstrap-v2/docs/examples/images/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="72x72" href="../bootstrap/twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="114x114" href="../bootstrap/twitter-bootstrap-v2/docs/examples/images/apple-touch-icon-114x114.png"> </head> <body> <div class="container"> <div class="row"> <div class="span12"> <form class="well form-search"> <input type="text" class="input-medium search-query"> <button type="submit" class="btn"><i class="icon-search"></i> Search</button> </form> </div> </div> <footer> <p>© Company 2013</p> </footer> </div> </body> </html>