
- Bootstrap Tutorial
- Bootstrap - Home
- Bootstrap - Overview
- Bootstrap - Environment Setup
- Bootstrap with CSS
- Bootstrap - Grid System
- Bootstrap - CSS Overview
- Bootstrap - Typography
- Bootstrap - Code
- Bootstrap - Tables
- Bootstrap - Forms
- Bootstrap - Buttons
- Bootstrap - Images
- Bootstrap - Helper Classes
- Bootstrap - Responsive utilities
- Bootstrap Layout Components
- Bootstrap - Glyphicons
- Bootstrap - Dropdowns
- Bootstrap - Button Groups
- Bootstrap - Button Dropdowns
- Bootstrap - Input Groups
- Bootstrap - Navigation Elements
- Bootstrap - Navbar
- Bootstrap - Breadcrumb
- Bootstrap - Pagination
- Bootstrap - Labels
- Bootstrap - Badges
- Bootstrap - Jumbotron
- Bootstrap - Page Header
- Bootstrap - Thumbnails
- Bootstrap - Alerts
- Bootstrap - Progress Bars
- Bootstrap - Media Object
- Bootstrap - List Group
- Bootstrap - Panels
- Bootstrap - Wells
- Bootstrap Plugins
- Bootstrap - Plugins Overview
- Bootstrap - Transition Plugin
- Bootstrap - Modal Plugin
- Bootstrap - Dropdown Plugin
- Bootstrap - Scrollspy Plugin
- Bootstrap - Tab Plugin
- Bootstrap - Tooltip Plugin
- Bootstrap - Popover Plugin
- Bootstrap - Alert Plugin
- Bootstrap - Button Plugin
- Bootstrap - Collapse Plugin
- Bootstrap - Carousel Plugin
- Bootstrap - Affix Plugin
- Bootstrap Demos
- Bootstrap - Grid Demo
- Bootstrap - Table Demo
- Bootstrap - Form Demo
- Bootstrap - Buttons Demo
- Bootstrap - Images Demo
- Bootstrap - Responsive Demo
- Bootstrap - Navigation Demo
- Bootstrap - Blog Demo
- Bootstrap - Material Design Demo
- Bootstrap - Slider Demo
- Bootstrap - Time line Demo
- Bootstrap - Alert Demo
- Bootstrap - Admin Interface Demo
- Bootstrap - Ajax Demo
- Bootstrap - Tabbed slider Demo
- Bootstrap - Caption Demo
- Bootstrap - Map Demo
- Bootstrap - Calendar Demo
- Bootstrap - Social Icons Demo
- Bootstrap - Icons Demo
- Bootstrap - featured Demo
- Bootstrap Useful Resources
- Bootstrap - Questions and Answers
- Bootstrap - Quick Guide
- Bootstrap - Useful Resources
- Bootstrap - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Bootstrap - Glyphicons
This chapter will discuss about Glyphicons, its use and some examples. Bootstrap bundles 200 glyphs in font format. Let us now understand what Glyphicons are.
What are Glyphicons?
Glyphicons are icon fonts which you can use in your web projects. Glyphicons Halflings are not free and require licensing, however their creator has made them available for Bootstrap projects free of cost.
"It is recommended, as a thank you, we ask you to include an optional link back to GLYPHICONS whenever practical". — Bootstrap Documentation
Where to find Glyphicons?
Now that we have downloaded Bootstrap 3.x version and understand its directory structure from the chapter Environment Setup, glyphicons can be found within the fonts folder. This contains the following files −
- glyphicons-halflings-regular.eot
- glyphicons-halflings-regular.svg
- glyphicons-halflings-regular.ttf
- glyphicons-halflings-regular.woff
Associated CSS rules are present within bootstrap.css and bootstrap-min.css files within css folder of dist folder. You can see the available glyphicons at this link GLYPHICONS.
Usage
To use the icons, simply use the following code just about anywhere in your code. Leave a space between the icon and text for proper padding.
<span class = "glyphicon glyphicon-search"></span>
The following example demonstrates this −
<p> <button type = "button" class = "btn btn-default"> <span class = "glyphicon glyphicon-sort-by-attributes"></span> </button> <button type = "button" class = "btn btn-default"> <span class = "glyphicon glyphicon-sort-by-attributes-alt"></span> </button> <button type = "button" class = "btn btn-default"> <span class = "glyphicon glyphicon-sort-by-order"></span> </button> <button type = "button" class = "btn btn-default"> <span class = "glyphicon glyphicon-sort-by-order-alt"></span> </button> </p> <button type = "button" class = "btn btn-default btn-lg"> <span class = "glyphicon glyphicon-user"></span> User </button> <button type = "button" class = "btn btn-default btn-sm"> <span class = "glyphicon glyphicon-user"></span> User </button> <button type ="button" class = "btn btn-default btn-xs"> <span class = "glyphicon glyphicon-user"></span> User </button>