html - 图片在 chrome 和 firefox 中不显示

标签 html css google-chrome firefox safari

图像在 firefox 和 chrome 中不显示。 Safari 工作正常。我在 CSS 中将图像编码为背景图像,并在 HTML 中编码图像。当我预览页面时,图像只能在 safari 中看到。为什么?这发生在我购买新电脑时。

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
</head>
<body>
<img src="img/background.png" alt="">
</body>
</html>

enter image description here

最佳答案

我发现了为什么图片在 firefox 和 chrome 中没有显示。图像本身出现错误。当我尝试将图像导入 photoshop 时,我发现 photoshopped 有一条错误消息说“无法放置“background.png”,因为文件格式模块无法解析文件。”所以我在 html 中制作了一个新图像,并将图像显示在浏览器上。

关于html - 图片在 chrome 和 firefox 中不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44988934/

相关文章:

html - 在同一行上获取 Twitter 推文和 Facebook 点赞

javascript - 使用 jquery 获取 <a> 选择器的 Id

css - 自定义字体未加载到 iframe 中

html - 为什么 [routerLink] 指令选择器定义为 :not(a)[routerLink]?

google-chrome - 为什么 Chrome DevTools 会显示我的 Vue 应用程序源代码的多个乱码版本?

javascript - 为什么我在 node.js 中使用 parseInt 会得到奇怪的结果? (与 chrome js 控制台的结果不同)

python - 从页面上的相对 url 重构绝对 url

html - 外部表单破坏了移动网站

html - 溢出自动在 Firefox 中不起作用它在 Chrome 中运行良好

Javascript + Chrome,控制台在我检查之前找不到元素