一个链接将我带到另一个页面!HTML

一个链接将我带到另一个页面!HTML,html,css,visual-studio-2013,Html,Css,Visual Studio 2013,CSS <style type="text/css"> #home { z-index: 100; position: absolute; color: white; font-size: 24px; margin-left: 25px; top: 18px; margin-right: 25px; visibility: hidden; } #aboutUs { z-index: 100; pos

CSS

   <style type="text/css">
#home {
    z-index: 100;
    position: absolute;
    color: white;
    font-size: 24px;
    margin-left: 25px;
    top: 18px;
    margin-right: 25px;
    visibility: hidden;
}
#aboutUs {
    z-index: 100;
    position: absolute;
    color: white;
    font-size: 24px;
    margin-left: 25px;
    top: 18px;
    margin-right: 25px;
    visibility: visible;
}

#services {
    z-index: 100;
    position: absolute;
    color: white;
    font-size: 24px;
    margin-left: 180px;
    top: 18px;
    margin-right: 25px;
    visibility: visible;
}

#support {
    z-index: 100;
    position: absolute;
    color: white;
    font-size: 24px;
    margin-left: 325px;
    top: 18px;
    margin-right: 25px;
    visibility: visible;
}

#contactUs {
    z-index: 100;
    position: absolute;
    color: white;
    font-size: 24px;
    margin-left: 460px;
    top: 18px;
    margin-right: 25px;
    visibility: visible;
}

#information {
    z-index: 100;
    position: absolute;
    color: white;
    font-size: 24px;
    margin-left: 600px;
    top: 18px;
    margin-right: 25px;
    visibility: visible;
}

#sponsored {
    z-index: 100;
    position: absolute;
    color: white;
    font-size: 24px;
    margin-left: 755px;
    top: 18px;
    margin-right: 25px;
    visibility: visible;
}

#reviews {
    z-index: 100;
    position: absolute;
    color: white;
    font-size: 24px;
    margin-left: 910px;
    top: 18px;
    margin-right: 25px;
    visibility: visible;
}
</style>

#家{
z指数:100;
位置:绝对位置;
颜色:白色;
字体大小:24px;
左边距:25px;
顶部:18px;
右边距:25px;
可见性:隐藏;
}
#关于{
z指数:100;
位置:绝对位置;
颜色:白色;
字体大小:24px;
左边距:25px;
顶部:18px;
右边距:25px;
能见度:可见;
}
#服务{
z指数:100;
位置:绝对位置;
颜色:白色;
字体大小:24px;
左边距:180像素;
顶部:18px;
右边距:25px;
能见度:可见;
}
#支持{
z指数:100;
位置:绝对位置;
颜色:白色;
字体大小:24px;
左边距:325px;
顶部:18px;
右边距:25px;
能见度:可见;
}
#联系人{
z指数:100;
位置:绝对位置;
颜色:白色;
字体大小:24px;
左边距:460像素;
顶部:18px;
右边距:25px;
能见度:可见;
}
#信息{
z指数:100;
位置:绝对位置;
颜色:白色;
字体大小:24px;
左边距:600px;
顶部:18px;
右边距:25px;
能见度:可见;
}
#赞助{
z指数:100;
位置:绝对位置;
颜色:白色;
字体大小:24px;
左边距:755px;
顶部:18px;
右边距:25px;
能见度:可见;
}
#评论{
z指数:100;
位置:绝对位置;
颜色:白色;
字体大小:24px;
左边距:910px;
顶部:18px;
右边距:25px;
能见度:可见;
}
HTML

<!DOCTYPE html>
<html> 
<head>
    <!-- Cheange Title of Webpage below -->
    <title>DTSU - Home</title>
    <link type="text/css" rel="stylesheet" href="stylesheet.css" />
</head>
<body>
    <!-- Div Buttons for Pages -->
    <p>
        <div id="mainNavD">
            <a href="home.html" id="home">Home</a>
            <a href="aboutUs.html" id="aboutUs">About Us</a>
            <a href="services.html" id="services">Services</a>
            <a href="support.html" id="support">Support</a>
            <a href="contactUs.html" id="contactUs">Contact Us</a>
            <a href="information.html" id="information">Information</a>
            <a href="sponsored.html" id="sponsored">Sponsored</a>
            <a href="reviews.html" id="reviews">Reviews</a>
            <img src="pictures/mainNavBar.jpg"/>
        </div>
    </p>
    <!-- Header and Logo Combo -->
    <div id="headerD">
        <img src="pictures/header.jpg" />
        <div id="logoD"></div>
    </div>
</body>
</html>

DTSU-主页

所有的页面都有相同的格式,因为这是我制作的模板

唯一的区别是

    <!-- Cheange Title of Webpage below -->
    <title>DTSU - Home</title>

DTSU-主页
将更改为页面的实际名称

在上面的代码中,当我单击服务链接或支持链接时,我会被重定向到主页,但是url中的链接是正确的


为什么会发生这种情况?

您可能在服务/支持页面HTML中错误地添加了主页内容……因此请检查这些页面中的HTML。

代码都是正确的。您可能已经在服务页面和支持页面上添加了相同的主页内容

只需通过查看浏览器中的URL栏(我们在那里写网址,如www.google.com)进行交叉检查即可

单击支持链接时,URL将为: *www.yourwebsite.com/*support.html

当您单击服务链接时,URL应为: *www.yourwebsite.com/*services.html

如果你发现了这个东西,它表明你已经在这些页面上复制粘贴了相同的内容


希望这对你有帮助

你确定这些页面的HTML不会重定向你吗?。。。那么你的问题是什么?就我所见,一切都很好。HTML/CSS标记没有问题。是否有一个重定向代码,或者这些页面的代码可能与主页相同?它会将我重定向到主页。但在url栏中,它显示的是正确的页面。但标题不会更改检查您的服务/支持页面HTML…可能它包含主页内容。