HTML超链接在导航栏中不起作用

Henry Zhu

我的HTML超链接在网页的导航栏上不起作用。我逐渐转移了我的内容stylesheetsscripts发现添加之后CSS file,超链接无法定向到该网页。最初,我发现导航菜单滑块部分重叠(在先前的StackOverflow问题中提到的问题),但是我为导航菜单本身指定了较高的z-index。抱歉,如果代码很长,但是我必须给所有代码以查看问题出在哪里。请尝试使响应成为实际的解决方法,而不是仅仅删除其中一个元素以停止覆盖。

的HTML

<div id="container">
    <header>
        <h1><b>Seattle</b>&Metropolitan</h1>
        <nav>
            <ul>
                <li><a href="about.html">About</a></li>
                <li>Buildings</li>
                <li id="contact">Contact Us</li>
            </ul>
        </nav>
    </header>
</div>
<div class="image-section">
    <img src="img/seattleskyline.jpg" alt="Seattle Skyline" id="center-image" />
    <div id="caption">A panoramic view of 1201 Third Avenue at night</div>
    <button id="sliderLeft" onclick="left();"></button>
    <button id="sliderRight" onclick="right();"></button>
</div>
<br><br>
<div class="content">
    Seattle's history can be traced back to the 1850s, when pioneers and natives started building a great city filled with a diverse culure, beautiful scenery, and a vibrant enviornment. The metropolitan area of Seattle now is a high-tech hub, in which four Fortune 500 companies reside: <a href="http://www.amazon.com/" alt="Amazon Website"><b>Amazon.com (#49)</b></a>, <a href="http://www.starbucks.com" alt="Starbucks Website"><b>Starbucks (#208)</b></a>, <a href="http://shop.nordstrom.com" alt="Nordstrom Website"><b>Nordstrom (#227)</b></a>, and <a href="http://www.expeditors.com" alt="Expeditors Website"><b>Expeditors International (#428)</b></a>. 
</div>

的CSS

@charset "utf-8";

body
{
    margin: 0;
    padding: 0;
    font-family: Open Sans, sans-serif;
}

#container
{
    width: 75%;
    margin-left: auto;
    margin-right: auto;
}

header h1
{
    font-size: 38px;
    float: left;
    font-weight: 100;
}

header nav ul
{
    list-style-type: none;
    margin: 0;
    vertical-align: middle;
    line-height: normal;
    float: right;
    z-index: 999;
}

header nav ul li
{
    line-height: 105px;
    display: inline;
    padding: 45px;
    font-size: 22px;
    font-weight: 100;
}

header nav ul li a
{
    color: black;
    text-decoration: none;
}

#center-image
{
    width: 100%;
    height: 480px;
}

#contact
{
    padding-right: 0;
}

.image-section
{
    margin-left: auto;
    margin-right: auto;
    width: 75%;
    position: relative;
    text-align: center;
}

.image-section #caption
{
    position: absolute;
    display: none;
    bottom: 4px;
    width: 100%;
    text-align: center;
    color: white;
    background: #474747;
    height: 50px;
    line-height: 50px;
    opacity: 0.8;
    font-size: 20px;
}

.image-section button
{
    outline: 0;
}

.image-section #sliderLeft
{
    position: absolute;
    display: none;
    width: 25px;
    height: 100px;
    top: 50%;
    margin-bottom: 50px;
    left: 0;
    opacity: 0.7;
    border: 0;
}

.image-section #sliderRight
{
    position: absolute;
    display: none;
    width: 25px;
    height: 100px;
    top: 50%;
    margin-bottom: 50px;
    right: 0;
    opacity: 0.7;
    border: 0;
}

.content
{
    margin-left: auto;
    margin-right: auto;
    width: 75%;
    font-size: 18px;
    line-height: 35px;
}

.content a
{
    text-decoration: none;
    color: black;
}

.content a:visited
{
    color: black;
}
阿里·加贾尼

您的问题出在.image-section

我通过更改 background-color:yellow;

显然,链接会在后台推送。

要修复它,请添加z-index:-1;.image-section

在此处输入图片说明

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

超链接在导航栏上不起作用-不可点击

来自分类Dev

导航栏中的链接不起作用

来自分类Dev

超链接在与JS代码连接的HTML代码中不起作用

来自分类Dev

Bootstrap导航栏下拉链接在Safari中不起作用

来自分类Dev

标签超链接在App Engine上不起作用

来自分类Dev

链接在ng-bind-html中不起作用

来自分类Dev

链接在ng-bind-html中不起作用

来自分类Dev

ul li链接不起作用(在导航栏中)

来自分类Dev

README.md的超链接在Gitlab中不起作用

来自分类Dev

超链接在Bootstrap v3.3.1中的xs屏幕上不起作用

来自分类Dev

超链接在移动响应式CSS中不起作用

来自分类Dev

超链接在Bootstrap v3.3.1中的xs屏幕上不起作用

来自分类Dev

html超链接不起作用

来自分类Dev

HTML 超链接不起作用

来自分类Dev

HTML 导航栏动画不起作用

来自分类Dev

主题左栏上的链接在Liferay 6.1.2 GA3中不起作用

来自分类Dev

为什么PDF中的超链接在智能手机上不起作用?

来自分类Dev

为什么PDF中的超链接在智能手机上不起作用?

来自分类Dev

Bootstrap 3导航栏链接不起作用

来自分类Dev

导航栏链接到其他页面不起作用

来自分类Dev

导航栏活动链接背景不起作用

来自分类Dev

动态生成的html链接在Firefox中有效,但在Chrome中不起作用

来自分类Dev

Bootstrap 导航栏页外(非锚点)链接不起作用,但文本中的 href 很好

来自分类Dev

WordPress中的SVG图像映射-超链接不起作用

来自分类Dev

转义的空间在超链接中不起作用

来自分类Dev

www链接在Apache中不起作用

来自分类Dev

图像映射链接在IE或Firefox中不起作用

来自分类Dev

深度链接在Chrome中不起作用

来自分类Dev

www链接在Apache中不起作用

Related 相关文章

热门标签

归档