Skip to content

Instantly share code, notes, and snippets.

@kieranbarker
Created October 29, 2020 18:20
Show Gist options
  • Save kieranbarker/c14af6f4fad1851e7598846eb5efb130 to your computer and use it in GitHub Desktop.
Save kieranbarker/c14af6f4fad1851e7598846eb5efb130 to your computer and use it in GitHub Desktop.
A simple snippet for an SVG favicon
Display the source blob
Display the rendered blob
Raw
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<text y=".9em" font-size="90">😊</text>
</svg>
@kieranbarker
Copy link
Author

Assuming the file is at the root of your project, put the following inside your HTML <head></head>:

<link rel="icon" href="favicon.svg" type="image/svg+xml">

You can replace the 'Smiling Face with Smiling Eyes' emoji with any emoji you want. Just open the file in your text editor.

Credit: Lea Verou.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment