- Is it really a
.ico
, or is it just named ".ico"?
- What browser are you testing in?
The absolutely easiest way to have a favicon is to place an icon called "favicon.ico" in the root folder. That just works everywhere, no code needed at all.
If you must have it in a subdirectory, use:
<link rel="shortcut icon" href="/img/favicon.ico" />
Note the /
before img
to ensure it is anchored to the root folder.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…