Icon Button HTML || How to Add Icon in HTML || How to Add Icon in HTML Title

Icon Button HTML || How to Add Icon in HTML || How to Add Icon in HTML Title



Tutorial in Hindi:



SOURCE CODE:

HTML CODE:

Step1- Copy and paste the HTML code mentioned below and save the file as "icons.html".


 <!DOCTYPE html>

<html>

<head>

<!-- Add icon library -->

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<style>

.btn {

  background-color:  #66cc00;

  border: none;

  color: white;

  padding: 12px 16px;

  font-size: 16px;

  cursor: pointer;

}

.btn:hover {

  background-color: RoyalBlue;

  color: darkred;

}

.btn1 {

  background-color: black;

  border: none;

  color: white;

  padding: 12px 16px;

  font-size: 16px;

  cursor: pointer;

}

.btn1:hover {

  background-color: #66cc00;

  color: blue;

}

h1{

  color: darkred;

  text-shadow: 0 0 3px #FF0000;

}

</style>

</head>

<body>

<h1 >IT in Hindi</h1>

<p>Icon buttons:</p>

<button class="btn"><i class="fa fa-home"></i></button>

<button class="btn"><i class="fa fa-bars"></i></button>

<button class="btn"><i class="fa fa-trash"></i></button>

<button class="btn"><i class="fa fa-close"></i></button>

<button class="btn"><i class="fa fa-folder"></i></button>

<button class="btn"><i class="fa fa-download"></i></button>

<button class="btn">  <i class="fa fa-spinner fa-spin"></i></button>

<p>Icon buttons with Name:</p>

<button class="btn1"><i class="fa fa-home"></i> Home</button>

<button class="btn1"><i class="fa fa-bars"></i> Menu</button>

<button class="btn1"><i class="fa fa-trash"></i> Trash</button>

<button class="btn1"><i class="fa fa-close"></i> Close</button>

<button class="btn1"><i class="fa fa-folder"></i> Folder</button>

<button class="btn1"><i class="fa fa-download"></i> Download</button>

<button class="btn1">  <i class="fa fa-spinner fa-spin"></i> Loading</button>

</body>

</html>




How to run the source code :-

Step1- Copy and paste the HTML code mentioned below and save the file as "icons.html".

Step2- Run "icons.html" file.


Post a Comment

0 Comments