Bra*_*don 12 html css scroll sticky-footer
我有一个完全水平的滚动网站,
TopNav(固定位置)
导航(固定位置)
内容(横向滚动)
页脚(固定位置)
一切似乎工作得很好,但我遇到的问题是,如果内容足够大,可以水平滚动,它会将页脚放在水平滚动条后面,所以在几页上我创建了#footer {bottom:16px}或者所以要考虑水平滚动条在那里.
我遇到的问题是不同的显示器分辨率.显然,内容将根据窗口大小水平滚动或不滚动.是否有任何方法可以将页脚保持在底部(或水平滚动条上方)无论什么分辨率或窗口大小?
Ger*_*ijk 30
经过大量的反复试验,我发现这是一个始终在底层的最佳解决方案:
HTML:
<div class="footer">
<div class="footer_contents"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.footer {
height:24px; // Replace with the height your footer should be
width: 100%; // Don't change
background-image: none;
background-repeat: repeat;
background-attachment: scroll;
background-position: 0% 0%;
position: fixed;
bottom: 0pt;
left: 0pt;
}
.footer_contents {
height:24px; // Replace with the height your footer should be
width: 1000px; // Visible width of footer
margin:auto;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
54356 次 |
| 最近记录: |