要在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>