我目前正在研究这个 page当它最初加载时,幻灯片缩略图将位于它们应该位于的位置,但稍后会下降。我试过从
.pika-thumbs {
width: 995px;
margin-left: 55px;
}
到
.pika-thumbs {
width: 995px;
margin-left: 55px;
position: relative;
top: -150px;
Z-index: 999;
}
它正好停留在我想要它停留的位置,但是当我删除整个 CSS 之类的东西时,空间会停留并消失。
最佳答案
你在 relative
之后忘记了你的分号:
.pika-thumbs {
width: 995px;
margin-left: 55px;
position: relative;
top: -150px;
z-index: 999;
}
编辑:
and it stayed exactly where I wanted it to stay but the space stays and goes away when I remove the whole like of CSS.
这就是使用负值的 position: relative
和 top 的实际情况。尝试 margin-top: -150px;
而不是 top
。
关于CSS定位问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12061950/