In this article we will learn about some of the frequently asked HTML programming questions in technical like “how to icon button in html” Code Answer. When creating scripts and web applications, error handling is an important part. If your code lacks error checking code, your program may look very unprofessional and you may be open to security risks. Error or stack handling on html was simple and easy. An error message with filename, line number and a message describing the error is sent to the browser. This tutorial contains some of the most common error checking methods in HTML. Below are some solution about “how to icon button in html” Code Answer.
how to icon button in html
xxxxxxxxxx
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<meta name="viewport" content="width=device-width, initial-scale=1">
5
<!-- Add icon library -->
6
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
7
<style>
8
.btn {
9
background-color: DodgerBlue;
10
border: none;
11
color: white;
12
padding: 12px 16px;
13
font-size: 16px;
14
cursor: pointer;
15
}
16
17
/* Darker background on mouse-over */
18
.btn:hover {
19
background-color: RoyalBlue;
20
}
21
</style>
22
</head>
23
<body>
24
25
<h2>Icon Buttons</h2>
26
<p>Icon buttons:</p>
27
<button class="btn"><i class="fa fa-home"></i></button>
28
<button class="btn"><i class="fa fa-bars"></i></button>
29
<button class="btn"><i class="fa fa-trash"></i></button>
30
<button class="btn"><i class="fa fa-close"></i></button>
31
<button class="btn"><i class="fa fa-folder"></i></button>
32
33
<p>Icon buttons with text:</p>
34
<button class="btn"><i class="fa fa-home"></i> Home</button>
35
<button class="btn"><i class="fa fa-bars"></i> Menu</button>
36
<button class="btn"><i class="fa fa-trash"></i> Trash</button>
37
<button class="btn"><i class="fa fa-close"></i> Close</button>
38
<button class="btn"><i class="fa fa-folder"></i> Folder</button>
39
40
</body>
41
</html>