在chrome上使用target

时间:2014-05-14 19:38:24

标签: html css google-chrome

我正在尝试在某些元素上启用:target,它似乎可以在我的手机上使用IE,Firefox甚至Chrome,但不知何故它无法在我的Chrome桌面上运行。有什么建议吗?

HTML(删除不相关的代码):

    <nav class="main-nav" id="main-nav">
        <a href="#gym">THE GYM</a>
    </nav>

<div class="page-wrap">
        <div class="content">
            <div class="gym" id="gym"></div>
        </div>
</div>

CSS:

.gym {
    z-index:3;
    position:fixed;
    height:200px;
    width:100%;
    background:#fff;
    bottom:0;
    left:0;
    box-shadow:2px 4px 4px rgba(0, 0, 0, 0.4);
    margin-bottom:-200px;
    transition: margin-bottom ease 1s;
    -webkit-transition: margin-bottom ease 1s;
    -o-transition: margin-bottom ease 1s;
    -moz-transition: margin-bottom ease 1s;

}

#gym:target {
    margin-bottom: 0;
}

顺便说一句,当我尝试使用JS执行此方法时,使用.css函数,它甚至无法工作......该网站位于boazkerengil.com

1 个答案:

答案 0 :(得分:0)

我不知道有什么事情坏了。它只是一个出现的白框,对吗?如果是这样,它正在发挥作用。以下是发生的事情的屏幕录制:http://cl.ly/VWDf。我使用的是Chrome Mac 34.0.1847.137。