固定导航(Sticky nav)

方法1:

<div class="footer">
</div>

.footer{
  position:fixed;
  bottom:0;
  left:0;
  width:100%;
  _position:absolute;
  _top:expression(documentElement.scrollTop + documentElement.clientHeight - this.offsetHeight);
  overflow:visible;
}

方法2:

CSS Sticky Footer,出自:http://www.cssstickyfooter.com/using-sticky-footer-code.html

<div id="wrap">
  <div id="main">
  </div>
</div>
<div id="footer">
</div>

* {margin:0;padding:0;}
html, body {height: 100%;}
#wrap {min-height: 100%;}
#main {overflow:auto;padding-bottom: 180px;}
#footer {position: relative;margin-top: -180px;height: 180px;clear:both;}
/*Opera Fix*/
body:before {
  content:"";
  height:100%;
  float:left;
  width:0;
  margin-top:-32767px;
}
<!--[if !IE 7]>
<style type="text/css">
  #wrap {display:table;height:100%}
</style>
<![endif]-->

此两种方法亦可用于顶部的导航。

posted @   全玉  阅读(291)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
点击右上角即可分享
微信分享提示