IMG和Favicon没有显示

时间:2016-10-12 13:58:16

标签: html css image

我一直试图显示图像,但它不起作用。我试图取消<img>标记末尾的 / ,但它既不起作用也不起作用。我的favicon也不会出现,我不知道为什么。 这是我的代码:

img.check {
  width: 15%;
  margin-top: 150px;
  margin-left: 790px;
}
.text {
  font-family: 'Roboto', sans-serif;
  font-size: 20px;
  margin-top: 150px;
  margin-left: 625px;
}
.redirect {
  font-family: 'Roboto', sans-serif;
  font-size: 8px;
  margin-top: 50px;
  margin-left: 830px;
  color: blue;
}
.redirect:hover {
  color: black;
  text-decoration: none;
}
<!DOCTYPE html>

<head>
  <link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">
  <title>Your Password has been changed.</title>
  <link rel="icon" type="image/png" href="img/zimbrafav.png" />
</head>

<body>
  <img src="img/check.png" class="check" alt="check">
  <div class="text">
    <p>
      <h1>Your password has been changed!</h1>
    </p>
  </div>
  <div class="redirect">
    <p>
      <h1><a href="http://google.be/">Go to Google > </a></h1>
    </p>
  </div>

</body>

</html>

1 个答案:

答案 0 :(得分:0)

不太确定,但可能是因为你正在使用相对路径而不是绝对路径。

所以

<img src="img/check.png" class="check" alt="check"/> 

会变成

<img src="/img/check.png" class="check" alt="check"/> 
相关问题