css 兼容ie6,ie7,ff的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]-->
相关推荐
qiupu 2020-11-04
多读书读好书 2020-11-03
RedCode 2020-10-28
jiedinghui 2020-10-25
Ladyseven 2020-10-22
hellowzm 2020-10-12
zuncle 2020-09-28
Ladyseven 2020-09-11
jiedinghui 2020-09-07
xiaohuli 2020-09-02
葉無聞 2020-09-01
impress 2020-08-26
ThikHome 2020-08-24
nicepainkiller 2020-08-20
hellowzm 2020-08-18