Sometimes, we want to add a favicon to a static HTML page.
In this article, we’ll look at how to add a favicon to a static HTML page.
How to add a favicon to a static HTML page?
To add a favicon to a static HTML page, wwe can use the link element.
For instance, we write
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="icon" type="image/png" href="https://example.com/favicon.png" />
to add link eleemnts with the href
attribute set to the URL of the favicon.
And we set rel
to icon
and type
to image/png
to make the browser know that it’s a png favicon.
Conclusion
To add a favicon to a static HTML page, wwe can use the link element.