html - 如何在视觉代码中使用图像它不起作用?
问题描述
使用图像标签的浏览器中未显示图像我错在哪里? 我想在 Web 中添加图像,但我无法在可视代码中使用它我不知道要在图像的 URL 中从哪里添加图像,所以任何人都可以指导。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sign up </title>
</head>
<body>
<div class="Header">
<a href="/" class="LogoWrapper" >
<img src="D:\my-angular-projects\signup-form\src\image\Snap.jpg" alt="Scone O'Clock logo" />
</a>
<p class="Strap">Scones: the most resplendent of snacks </p>
</div>
<div class="IntroWrapper">
<p class="IntroText">
Occasionally maligned and misunderstood; the scone is a quintessentially British classic.
</p>
<div class="MoneyShot">
<img class="MoneyShotImg" src="D:\my-angular-projects\signup-form\src\image\1555932407.jpg" alt="Incredible scones" />
<p class="ImageCaption">Incredible scones, picture from Wikipedia</p>
</div>
</div>
<p>Recipe and serving suggestions follow.</p>
<div class="Ingredients">
<h3 class="SubHeader">
Ingredients</h3>
<ul>
</ul>
</div>
<div class="HowToMake">
<h3 class="SubHeader">Method</h3>
<ol class="MethodWrapper">
</ol>
</div>
</body>
</html>
解决方案
问题是您的文件根据 html 文件的位置检索图像,并且它不会检查整个计算机硬盘驱动器。
因此,如果您想解决问题,基本上可以从 html 文件位置开始。因此,如果您的 html 文件位于 src 文件夹中,则您的 img 标签应为
<img src="image/1555932407.jpg">
否则,如果您在注册表格文件夹中有您的 html 文件,我将使用它
<img src="src/image/1555932407.jpg">
希望你发现这很有用,否则只需评论这篇文章。
推荐阅读
- java - 使用按钮使 UI 更好(java)
- node.js - 使用云代理针对 Google Cloud SQL DB 进行 Azure Pipelines 集成测试
- c++ - 标准 mac / Windows 问题
- c# - 无法通过事件中心在 Azure 流分析上接收输入
- ios - Xcode,Swift:如何检测链接点击并停止重定向 Safari?
- java - JSP 无法正确评估数组索引
- asp.net-core-mvc - 在连接表 asp.net core 中获取额外的字段值
- java - 图像未使用 java 存储在数据库中
- css - HTML & CSS 尺寸监视器
- java - 经过连续的Full GC(Ergonomics),堆的大小没有改变