by Sai gowtham

How to add a favicon in HTML file

In this tutorial, we are going to learn about how to add a favicon to your website.

Favicon is a graphical image or favicon.ico file which is displayed on the browser tab that tells you which website you are browsing in.

Adding a favicon to HTML

  1. Open the website folder in your favorite code editor.
  2. Download the favicon image or favicon.ico file and place it inside the root folder of your website.
  3. Add the following link tag to <head> tag of your HTML file and replace it with your favicon path.
<link rel="icon"  href="/favicon.ico"/>

for image file

<link rel="icon" type="image/png" href="/favicon.png"/>
  1. Reload the webpage to see the new favicon you have added.

Top Udemy Courses

JavaScript - The Complete Guide 2021 (Beginner + Advanced)
JavaScript - The Complete Guide 2021 (Beginner + Advanced)
64,026 students enrolled
52 hours of video content
View Course
React - The Complete Guide (incl Hooks, React Router, Redux)
React - The Complete Guide (incl Hooks, React Router, Redux)
284,472 students enrolled
40 hours of video content
View Course
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
Vue - The Complete Guide (w/ Router, Vuex, Composition API)
152,857 students enrolled
48.5 hours of video content
View Course