侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

css 兼容ie6,ie7,ff的fixed,元素上下端固定定位方法

2024-05-16 星期四 / 0 评论 / 0 点赞 / 104 阅读 / 874 字

<style type="text/css"> body{ background-image:url(about:blank); background-attachment:fixed;/*必要,防抖

<style type="text/css"> body{ background-image:url(about:blank); background-attachment:fixed;/*必要,防抖动*/ } .head,.foot{ position:fixed;*position:absolute; *left:0;z-index:21; background:#999; height:30px; width:500px; } .foot{ *bottom:0;} .main{ height:2000px; } </style> <!--[if lt IE 8]> <style type="text/css"> /*ie6和ie7 fix顶端元素*/ .head{ top:expression(eval(document.documentElement.scrollTop)); } /*ie6和ie7 fix底端元素*/ .foot{ top: expression(eval((document.compatMode&&document.compatMode=="CSS1Compat")?documentElement.scrollTop+documentElement.clientHeight-this.clientHeight-1:document.body.scrollTop+document.body.clientHeight-this.clientHeight-1)); } </style> <![endif]--> 

转载自:http://www.9958.pw/post/css_position_fixed

广告 广告

评论区