我尝试将网站图标(favicon)插入到我的网页中,但无法正常工作。请问有人可以告诉我需要插入的代码和样式吗?
<html>
<head>
<title>Welcome to Crash - Login or Signup</title>
<link rel="stylesheet" type="text/css" href="crash_styling.css"></link>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
</head>
<body link="#336666" alink="red" vlink="red">
<div id="header_title">
<h1 id="title">crash</h1>
<p id="motto">Keep track of all your assignments and projects.</p>
</div>
<form name="input" action="html_form_action.asp" method="get" id="user_passEntry">
Username:<input type="text" name="username" placeholder="Your Username" /> <br />
Password:<input type="password" name="password" placeholder="Your Password" />
<input type="submit" value="submit">
</form>
<p id="description">Crash is a way students can keep track of their projects and assignments on the computer or on their devices. With crash, you can be sure you'll never turn in something late again.</p>
<div class="make"><a href="crash_styling" style="text-decoration:none"/>Make a New Assignment</div>
<div class="edit"><a href="crash_styling" style="text-decoration:none"/>Edit an Assignment</div>
<div class="check"><a href="crash_styling" style="text-decoration:none"/>Check off an Assignment</div>
</body>
</html>
href="/favicon.ico"
而不是相对路径href="favicon.ico"
吗? - Teneffhttp://localhost/a/b/c/d/e/
,则相对路径将寻找http://localhost/a/b/c/d/e/favicon.ico
,而绝对路径将寻找http://localhost/favicon.ico
。 - Teneff/
前面什么都没有。如果是somefolder/favicon.ico
或者../favicon.ico
,我就能理解了,但这个呢? - paddotk