The favicon can be in any image format (ico, png, jpg) and the most recommended design and style of your website favicon is to have it look good on both light and dark theme colors.
To add the favicon prepare an image at least around 32px in width and height and the format can be any image format. Once you have that ready you can add the following code in your "head" HTML tag.
To add the favicon prepare an image at least around 32px in width and height and the format can be any image format. Once you have that ready you can add the following code in your "head" HTML tag.
<title>Your website title here</title> <link rel="shortcut icon" type="image/jpg" href="your-favicon-here.jpg"/>
Do note on the type of the image. For the above code it's jpg but you can also have ".png" format and you can define it like below.
<link rel="icon" type="image/png" href="your-favicon-here.png">
An example of .png favicon is PostSrc favicon.
<link rel="icon" type="image/png" href="https://postsrc.com/favicon.png">
Mobile Favicon View
The mobile favicon will look like the following.