favicon to react application doesn't work
favicon to react application doesn't work
i want to add favicon to my react application but doesn't seem to work.
Tried the below:
add the code to index.html file in the head section
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#ffc40d">
<meta name="theme-color" content="#ffffff">
Also placed the icons in the same folder as index.html. Could you please let me know where the problem persists.thanks.
Possible duplicate of How to add a browser tab icon (favicon) for a website?
– Richard Szakacs
26 mins ago
Possible duplicate of Add Favicon with React and Webpack
– Rehan Haider
26 mins ago
tried using ico files but dint work
– swathi
3 mins ago
1 Answer
1
you need to use relative path eg: PUBLIC_URL
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon-32x32.png">
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
For favicon try using ico files instead of png
– Help
27 mins ago