html - html 页面上的按钮不会打开到单独的页面

标签 html css web button

我无法让主页底部的按钮链接到包含各种信息的其他页面,例如我在访问中制作的表格。这是关于信息技术的大学入门类(class)的期末元素,我从未制作过网站。

尝试了很多不同的东西,但它似乎只能在所有文件都已下载的计算机上运行,​​而不是从非本地服务器上运行。

您应该可以点击底部的按钮,它会打开一个包含其他信息的单独页面。我尝试上传到代码中的所有其他文件都已保存为 .html

<html><head>
</head><body bgcolor="#808080" <link="" rel="stylesheet" type="text/css" href="style.css">


<h1>
    Serial Killers
</h1>
<h3>LIS 351 Final Project by Luke Tinsey</h3>
<img src="https://i.pinimg.com/originals/59/56/be/5956bef9b1d3384714d5e37826e41055.png" alt="Serial Killer Collage" width="400" height="300">
<p style="font-size: 25px;">
    My project is about serial killers and I'm interested in creating a database that includes details about some of the most infamous killers in the world.
    I list things such as their names, methods of killing, hometowns, confirmed and potential kills.
</p><p>
</p><p style="font-size: 25px;"></p>
    The serial killers I focused on are:
    <ul>
    <li>1. Ted Bundy</li>
    <li>2. Jeffrey Dahmer</li>
    <li>3. Harold Shipman</li>
    <li>4. Belle Gunness</li>
    <li>5. John Wayne Gacy</li>
    <li>6. Edmund Kemper</li>
    <li>7. Gary Ridgway</li>
</ul>
<p></p>
<p></p>
<p>Click the links below for some more information!</p>
<button onclick="window.location.href='SerialKillersInfo%20Query.html'">Serial Killer Information</button>
<button onclick="window.location.href='Method%20Query.html'">Methods</button>
<button onclick="window.location.href='Documentation%20Query.html'">Documentation</button>
<button onclick="window.location.href='Method_Killer%20Query.html'">Cold Weather Correlation</button>
<p></p>
<p></p>
<button onclick="window.location.href='citations.html'">Citations</button>
<button onclick="window.location.href='Reflection%20Response.htm'">Reflection Response</button>
</body></html>

最佳答案

如果您的其他 .html 文件与此文件位于同一文件夹/目录中,请将您的链接更改为该文件。

<button onclick="window.location.href='./SerialKillersInfo%20Query.html'">Serial Killer Information</button>

我还强烈建议您删除文档名称中的空格并安装 SerialKillersInfoQuery.html

<button onclick="window.location.href='./SerialKillersInfoQuery.html'">Serial Killer Information</button>

简而言之,只需在您的 html 文件的名称前添加 ./infront。

关于html - html 页面上的按钮不会打开到单独的页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55978346/

相关文章:

html - 表格行中的简单纯 css 滑出按钮

css - 使用 CSS 像小说一样构建段落

c# - Web 应用程序和网站中的 app_data 文件夹有什么区别?

php - 如何验证写在帖子上的评论是否真的写到了该帖子?

html - iframe 显示空白

css - 我可以将这些 css 类合并为一个 css 类吗?

visual-studio-2010 - 为什么 Visual Studio 2010 发布带有源代码的网站?

html - 如何使用Polymer实现富文本编辑器?

javascript - 使用 JavaScript 读取文本文件的内容抛出错误

html - 镜像 HTML 元素,可能使用影子 DOM