html - 我的 HTML 文件找不到任何其他文件并返回 404
问题描述
HTML 找不到位于同一根目录中的 .js、.png 或任何其他文件并返回 404。我已尝试在 html 中格式化链接以尽可能多地引用 css,但仍然没有结果。
HTML 代码:
<!DOCTYPE html>
<html lang="en">
<head>
<link href="style.css" rel="stylesheet" type="text/css"/>
<meta charset="UTF-8" />
<title>Simple website for ASCII Art Generator</title>
</head>
<body>
<h1>ASCII Art Generator</h1>
<div>
<form method="POST" action="/">
<center>
<textarea type="text" name="input" rows="4" cols="80" placeholder="Write text here"></textarea> />
<br>
<label for="banner">Font:</label>
<select id="banner" name="banner">
<option value="standard">Standard</option>
<option value="shadow">Shadow</option>
<option value="thinkertoy">Thinkertoy</option>
</select>
<input type="submit" value="submit" /></input>
</center>
</form>
</div>
<div>
<center>
<textarea class="output" readonly="" wrap="off" rows="20" cols="110">{{.Text}}</textarea>
</center>
</div>
<div>
<a href="result.txt" download>
<img src="images/download-button.jpg" alt="Download Button">
</a>
</div>
</body>
</html>
目录:
-folder
-server.go
-form.html
-style.css
--images
-download-button.jpg
在 Edge 开发工具中,它显示一个空白 style.css
解决方案
尝试将“../”添加到 img src:
<img src="../images/download-button.jpg" alt="Download Button">
推荐阅读
- ios - 如何将日期字符串快速转换为 NSDate 类型
- sql - 如何在sql中选择一年中的哪一天
- php - 如果选择没有匹配的行,MySQLi 查询返回值
- javascript - Javascript中的一些奇怪的东西
- javascript - React Native Maps FlatList scrollToIndex() 不是函数/未定义
- r - 具有分类 X 的 JAGS 中的 Dirichlet 多项式模型
- java - 实现并发队列
- angular - 如何显示按ID过滤的数据?
- java - 是什么角色
玩这个定义的 ShoppingBasket 类? - sql - 即使列中有一条记录,Excel-VBA SQL查询也会返回空白