【发布时间】:2015-05-15 08:27:10
【问题描述】:
我有一个徽标,应该位于固定容器的最底部。它适用于 position: absolute;但是,如果我添加溢出-y:自动;到固定容器并添加不适合视口高度的内容,我的徽标会粘在视口底部,而不是固定容器的底部,从而与内容重叠。
<div class="foo">
<div class="content"></div>
<div class="logo-in-the-bottom">Logo</div>
</div>
.foo {
position: fixed;
top: 0; left: 0;
width: 100%; height: 100%;
background: gray;
overflow-y: auto;
}
.content {
height: 1000px;
}
.logo-in-the-bottom {
position: absolute;
bottom: 10px; left: 0;
color: white
}
无论内容高度如何,如何将其粘贴到固定容器的底部?
【问题讨论】:
标签: html css position absolute