0

我无法单击 div 中的链接 is position:absolute。它似乎不适用于移动 android,因为它在 Chrome 甚至 ie8 的桌面上运行良好。

一旦我删除它的风格。msg-inner 类仅适用于 jQuery,它具有 scrollTop 没有样式。我已经阅读了很多答案并在内部 div 上使用z-index或,但没有一个有效。position:relative我什至尝试position:fixed在 msg_container 上使用和同样的问题。内部 div 滚动,一切看起来都正确,但只是链接坏了,顺便说一句,偶尔有些会起作用,有些不起作用。我拿走了所有样式,只是在里面放了简单的链接,看看它是否是格式问题,仍然没有。

<div id="msg_container" class="absolute" style="overflow-y:auto;width:100%;height:75%">
    <div class="msg_inner">

.... stuff in here with links
</div><!--msg inner-->
    </div><!--msg_container-->

CSS

.absolute {
position: absolute;
}
4

1 回答 1

1

#msg_container不应该有绝对的立场,.msg_inner应该。尝试这个:

HTML

<div class="msg_container">
    <div class="msg_inner">
        .... stuff in here with links
    </div><!--msg inner-->
</div><!--msg_container-->

CSS

.msg_container {
    position: relative;
    width: 400px;
    height: 400px;
}

.msg_inner {
    position: absolute;
    top: 0px;
    left: 0px;
}

另请注意,我创建了msg_container一个类,而不是一个 ID。拥有多个同名 ID 被认为是不好的做法。虽然我当然不知道你的代码,但我假设你可能msg_container在一个页面上有多个 s ......所以我使用了一个类。

于 2013-04-13T23:12:52.413 回答