4

我绝对将元素定位在浮动 div 中。在我们调整窗口大小之前,最后一个绝对定位的元素会粘在 chrome 中的 div 顶部(请参见此处

到目前为止我尝试过的事情:

  • 将容器放入浮动元素中
  • 溢出:隐藏/自动到浮动、元素和容器

这只发生在 chrome 中。知道为什么/发生了什么吗?

在此处输入图像描述

4

2 回答 2

2

只有你必须做的小事,其他一切都很棒。用这个

.schedule-course-slot-wrapper {
position: absolute; /*Important*/
border: thin solid;
border-radius: 3px;
margin: 0 2px;
padding: 0 3px;
height: 100%;
}

反而

.schedule-course-slot-wrapper {
position: relative; /*Important*/
border: thin solid;
border-radius: 3px;
margin: 0 2px;
padding: 0 3px;
height: 100%;
}
于 2013-04-08T20:29:25.723 回答
0

你必须使用

pop.style.left = l+"px";
pop.style.top = t+"px";

代替

pop.style.posLeft = l;
pop.style.posTop = t;

或两者。

于 2014-07-03T23:28:50.120 回答