ファビコンをサイトに設定する方法(HTMLタグ)
- ZIPを展開
- ファイルをサイトに置く
- タグを貼る
ファビコンを作ったら、サイトに設定します。ファビコン(サイトのアイコン)を作る のZIPには、貼り付けるタグが書かれた html-tags.txt が入っています。
手順
- 「画像を選ぶ」で画像を選び、「ファビコンを作る」で作ります。
- 「ZIPを保存する」で保存し、展開(解凍)します。
- 中のファイル(PNG・favicon.ico)を、サイトのフォルダ(公開する場所)にアップロードします。
- html-tags.txt を開き、中のタグをコピーします。
- サイトの各ページの <head> の中に、貼り付けます。
- サイトを開いて、タブにアイコンが出るか確認します。
タグの例
html-tags.txt には、次のような内容が入っています。
- アイコンを指定する <link rel="icon" ...> のタグ
- スマホのホーム画面用の <link rel="apple-touch-icon" ...> のタグ
サイズごとに、行が分かれています。
ファイルを置く場所
一番多いのは、サイトの一番上(ルート)のフォルダです。そこに置けば、パスは「/favicon.ico」のように書けます。
パスの確認
タグの中の、ファイルの場所(href)が、実際に置いた場所と合っているか確認します。合っていないと、表示されません。
設置後の確認
- サイトを開く。
- タブの端に、アイコンが出るか見る。
- 出ない場合は、ページを再読み込みする。
- それでも出ない場合は、ブラウザのキャッシュが原因のことがある。別の解説で説明しています。
ブログサービスを使っている場合
WordPressなどのサービスでは、設定画面から、画像をアップロードするだけでよい場合があります。別の解説で説明しています。
例
自分で作ったサイトの、ルートに、favicon.icoとPNGを置き、各ページの<head>に、html-tags.txtのタグを貼った。
つまずきやすい点
- タグを貼ったのに、出ない:パスが違う、またはキャッシュです。
- 一部のページだけ出ない:すべてのページの<head>に、タグが必要です。
- スマホのアイコンが違う:apple-touch-iconのタグを確認します。
よくある質問
HTMLが分からなくても設定できますか?
ブログサービスなら、設定画面で画像を選ぶだけのことが多いです。
まとめ
ファイルを置いて、タグを<head>に貼る。パスの合致を、確認しましょう。
ファビコン(サイトのアイコン)を作るを使う(無料)あわせて使えるツール
- 画像の切り抜き・回転:画像を、好きな範囲や比率で切り抜きます。回転もできます。
- 画像のサイズ(ピクセル)を変える:画像の大きさを、横幅・縦・割合で変えます。
- 画像の形式を変換(JPG・PNG・WebP):画像をJPG・PNG・WebPに、まとめて変換します。
同じツールの、ほかの解説
How to Add a Favicon to Your Site (HTML Tags)
- Unzip
- Upload the files
- Paste the tags
Once you have made a favicon, set it up on your site. The ZIP from Make a Favicon (Site Icon) contains html-tags.txt with the tags to paste.
Steps
- Choose an image with "Choose images" and make it with "Make favicon".
- Save with "Save ZIP" and unzip it.
- Upload the files inside (PNGs and favicon.ico) to your site's folder (the public location).
- Open html-tags.txt and copy the tags inside.
- Paste them into the <head> of each page of your site.
- Open the site and check that the icon appears in the tab.
Example of the tags
html-tags.txt contains things like:
- A <link rel="icon" ...> tag specifying the icon
- A <link rel="apple-touch-icon" ...> tag for the phone home screen
There is a line for each size.
Where to put the files
Most commonly in the site's top (root) folder. Put them there and the path can be written like "/favicon.ico".
Checking paths
Check that the file location (href) in the tags matches where you actually placed them. If not, it will not appear.
Checking after setup
- Open the site.
- See whether the icon appears at the edge of the tab.
- If not, reload the page.
- If it still does not appear, the browser cache may be the cause. Explained in a separate guide.
If you use a blog service
On services such as WordPress, you may only need to upload the image in the settings screen. Explained in a separate guide.
Example
Placed favicon.ico and the PNGs in the root of a self-made site and pasted the tags from html-tags.txt into each page's <head>.
Common stumbling blocks
- Pasted the tags but it does not appear: wrong path, or cache.
- Appears only on some pages: the tags are needed in the <head> of every page.
- The phone icon is different: check the apple-touch-icon tag.
Frequently asked questions
Can I set it up without knowing HTML?
With a blog service, you often just choose the image in the settings screen.
Summary
Place the files and paste the tags into the <head>. Check that the paths match.
Use "Make a Favicon (Site Icon)" (free)Tools that go well with this
- Crop & Rotate Image: Crop an image to any area or ratio, and rotate it.
- Resize Images by Pixel Size: Resize images by width, height or percentage.
- Convert Image Format (JPG, PNG, WebP): Convert images to JPG, PNG or WebP, several at once.