html - Mozilla Firefox 未从本地计算机加载图像
问题描述
我正在尝试使用图像和 div 运行一个简单的 html 页面。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=Quicksand" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<style>
* {
box-sizing: border-box;
}
.container {
width: 240px;
height: 280px;
position: relative;
}
.tag {
position: absolute;
left: 10%;
bottom: 0px;
height: 220px;
width: 202px;
background-color: #4a8ab0;
border-radius: 6px;
color: #FFFFFF;
padding: 10px;
opacity: 0.9;
}
.sideHeader {
font-family: 'Quicksand', sans-serif;
font-size: 18px;
}
p {
font-family: 'Open Sans', sans-serif;
font-size: 11.5px;
letter-spacing: 0.01em;
}
</style>
</head>
<body>
<!---->
<div class="container">
<img src="D:/ata/images/cropped_box.jpg" style="height:210px;width:240px;">
<div class="tag"><div class="sideHeader"><b>Did you know</b></div>
<p>
With HTML you can create your own Website.This tutorial teaches you everything about HTML.HTML is easy to learn - You will enjoy it.
</p>
</div>
</div>
</body>
</html>
我可以在显示图像和 div 的 Google chrome 和 Internet Explorer 中成功运行代码。在 Mozilla firefox 中,不显示图像。它也没有显示错误。我尝试在互联网上使用图像。这显示得很好。为什么 Mozilla 对本地数据的行为不同?这是浏览器特定的问题吗?我使用的是 66.0.2(64 位)版本的 Firefox。我该如何解决?我尝试将反斜杠更改为前斜杠。但它不起作用。请帮忙。提前致谢。
解决方案
那么解决方案很简单。将图像标签重写为:
<img src="file://D:/ata/images/cropped_box.jpg" style="height:210px;width:240px;">
推荐阅读
- mod-wsgi - 是否可以在本地测试“POST”请求?如果是,如何?
- python - Python/seaborn 函数不工作 set_xticklabels() 不按预期工作
- android - 当 map.isMyLocationEnabled = false 时,FusedLocations 不会发送位置更新。奇怪的行为
- nginx - NGINX 502 Bad Gateway - 2 个 Spring 应用程序 - 1 个有效,1 个无效
- c# - 在 CefSharp 中拦截表单的 POST
- jquery - 使用动态表单YII2动态生成Id时如何使用onchange
- class - 无法使用元表从 lua 中的基类创建实例
- java - 在继承的接口中查询方法公共抽象的验证失败
- reactjs - 反应原生 setstate 不改变状态值
- python - python应该在哪里为模块安装脚本