Bootstrap Glyphicons
Posted by Superadmin on April 30 2023 15:49:12

Bootstrap Glyphicons

By Mrunali PangeMrunali Pange
  

Bootstrap Glyphicons

Introduction to Bootstrap Glyphicons

The Glyphicons are icons of font which is used mostly in web applications. The Glyphicons Halflings set has 250 glyphs but this is not free of cost. To get icons, we need a license. The Glyphicons Halflings creator made these icons are free of cost for bootstrap projects. The Glyphicons are a set of symbols and icons to understand more effectively and easily in web projects. The Glyphicons are used for some texts, forms, buttons, navigation, and etc.

Syntax:

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

What is Bootstrap Glyphicons?

Bootstrap Glyphicons help to get clean symbols about information. It helps to understand the content easily. The following size of glyphicons may vary according to requirement. The following some important glyphicons which are used commonly in web applications:

Syntax Icons
<span class = “glyphicon glyphicon-asterisk”></span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-plus”> </span>
plus
<span class = “glyphicon glyphicon-minus”></span>
minus
<span class = “glyphicon glyphicon-euro”> </span>
euro
<span class = “glyphicon glyphicon-cloud”> </span>
cloud
<span class = “glyphicon glyphicon-envelope”> </span>
envolape
<span class = “glyphicon glyphicon-pencil”> </span>
pencil
<span class = “glyphicon glyphicon-glass”> </span> glass
<span class = “glyphicon glyphicon-music”> </span> music
<span class = “glyphicon glyphicon-search”> </span>
<span class = “glyphicon glyphicon-heart”> </span>
heart
<span class = “glyphicon glyphicon-menu-left”> </span>
menu left
<span class = “glyphicon glyphicon-menu-right”> </span>
menu right
<span class = “glyphicon glyphicon-menu-down”> </span>
menu down
<span class = “glyphicon glyphicon-menu-up”> </span>
menu up
<span class = “glyphicon glyphicon-triangle-left”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-triangle-bottom”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-triangle-top”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-triangle-right”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-usd”> </span>
usd
<span class = “glyphicon glyphicon-gbp”> </span>
gbp
<span class = “glyphicon glyphicon-sort-by-alphabet”> </span>
short by alphbate
<span class = “glyphicon glyphicon-sort-by-order”> </span>
short by order
<span class = “glyphicon glyphicon-phone”> </span>
phone
<span class = “glyphicon glyphicon-link”> </span>
<span class = “glyphicon glyphicon-briefcase”> </span>
breif case
<span class = “glyphicon glyphicon-filter”> </span>
filter
<span class = “glyphicon glyphicon-star”> </span>
star 1
<span class = “glyphicon glyphicon-star-empty”> </span>
emplty star
<span class = “glyphicon glyphicon-user”> </span>
user
<span class = “glyphicon glyphicon-film”> </span>
flim
<span class = “glyphicon glyphicon-ok”> </span>
ok
<span class = “glyphicon glyphicon-remove”> </span>
remove
<span class = “glyphicon glyphicon-zoom-in”> </span>
zoom in
<span class = “glyphicon glyphicon-zoom-out”> </span>
zoom out
<span class = “glyphicon glyphicon-off”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-signal”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-trash”> </span>
trash
<span class = “glyphicon glyphicon-home”> </span>
home
<span class = “glyphicon glyphicon-cog”> </span>
cog
<span class = “glyphicon glyphicon-file”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-time”> </span>
time
<span class = “glyphicon glyphicon-download”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-upload”> </span>
upload
<span class = “glyphicon glyphicon-play-circle”> </span>
play circle
<span class = “glyphicon glyphicon-repeat”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-refresh”> </span>
refresh
<span class = “glyphicon glyphicon-lock”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-headphones”> </span>
headphone
<span class = “glyphicon glyphicon-volume-off”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-volume-down”> </span>
volume down
<span class = “glyphicon glyphicon-volume-up”> </span>
volume up
<span class = “glyphicon glyphicon-print”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-camera”> </span>
camera
<span class = “glyphicon glyphicon-map-marker”> </span>
map marker
<span class = “glyphicon glyphicon-play”> </span>
Bootstrap Glyphicons
<span class = “glyphicon glyphicon-pause”> </span>
pause
<span class = “glyphicon glyphicon-stop”> </span>
Bootstrap Glyphicons

Examples to Implement Bootstrap Glyphicons

Below are the examples to implements:

Example #1

This example helps to understand how to glyphicons works in web projects.

Code:

<!DOCTYPE>
<html>
<head>
<title> Bootstrap Glyphicons 1 </title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>
<link rel="stylesheet"    href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
</head>
<body>
<h2> Signup Form </h2>
<form>
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input type="text" class="form-control" name="username" placeholder="Username">
</div>
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-envelope"></i></span>
<input type="text" class="form-control" name="email" placeholder="Email">
</div>
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-lock"></i></span>
<input type="password" class="form-control" name="password" placeholder="Password">
</div>
<div class="input-group">
<input type="submit" class="btn btn-default" >
</div>
</form>
</body>
</html>

Output:

Bootstrap Glyphicons - 3

Explanation to the above code: The class = “input-group-addon” is used for icons that are placed next to the input field attribute. We are using icons for form format. The form can look attractive and meaningful. Every input field has a meaning like username, password, and email. For Username glyphicon-user class used in vertically. The password and email used glyphicon-envelop and glyphicon-lock respectively.

Example #2

We can use glyphicons according to the required size. The icon Size can large, small, extra small, and default. Show in the following example.

Code:

<!DOCTYPE>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
</head>
<body>
<hr>
<button type = "button" class = "btn btn-primary btn-xs">
<span class = "glyphicon glyphicon-camera"></span> Photo
</button>
<hr>
<button type = "button" class = "btn btn-primary btn-sm">
<span class = "glyphicon glyphicon-camera"></span>
Photo
</button>
<hr>
<button type = "button" class = "btn btn-primary ">
<span class = "glyphicon glyphicon-camera"></span>
Photo
</button>
<hr>
<button type ="button" class = "btn btn-primary btn-lg">
<span class = "glyphicon glyphicon-camera"></span>
Photo
</button>
<hr>
</body>
</html>

Output:

Bootstrap Glyphicons - 4

Explanation to the above code: Using buttons we can modify icons according to size. Here we used the primary button class. We need button class as well btn-size class to modify icons with the size of buttons. The btn-lg means a large button as like btn-sm means small button.

Example #3

The Bootstrap glyphicons with CSS example is below.

Code:

<!DOCTYPE>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<style>
#icon1 {
color: blue;
font-size: 30px;
border: 1px solid black;
margin-left: 10px;
background-color: yellow;
}
#icon2 {
color: orange;
font-size: 30px;
margin-left: 10px;
}
#icon3 {
color: red;
font-size: 30px;
margin-left: 10px;
}
#icon4 {
color: silver;
background-color : black;
font-size: 30px;
margin-left: 10px;
}
</style>
</head>
<body>
<hr>
<span id= "icon1" class = "glyphicon glyphicon-camera"></span> Photo
<hr>
<span id= "icon2" class = "glyphicon glyphicon-envelope"></span>
Email
<hr>
<span id= "icon3" class = "glyphicon glyphicon-heart"></span>
Heart
<hr>
<span id= "icon4" class = "glyphicon glyphicon-star"></span>
Star
<hr>
</body>
</html>

Output:

BEFORE

Bootstrap Glyphicons - 5

After

Bootstrap Glyphicons - 6

Explanation to the above code:  You can see the difference between after and before icons. Using CSS we can change the size, color, background-color, margin, etc.

Conclusion

The bootstrap glyphicons are an icon used for form, text, navigation and many other web components. This helps to reduce text and give meaningful information in short.