DEV Community

Discussion on: Definitive edition of "How to Favicon" in 2023

Collapse
 
multiwebinc profile image
Mike Robinson

Boulanger (2020) claims that the type attribute is unnecessary. But Can I Use (2021a) says all the browsers that support SVG favicons (Chrome 80+, Edge 80+, Firefox 41+, Opera 67+) require "the served mime-type to be image/svg+xml".

You're getting mixed up between the type attribute in the HTML and the served mime-type, which is returned by the server when making the request to retrieve the file. The type attribute in the HTML is not needed. However the server needs to respond with a Content-Type: image/svg+xml header when the request is made.