中易网

怎么解决搜狗兼容模式与position':'fixed属性兼容问题

答案:1  悬赏:10  
解决时间 2021-04-21 15:13
我做了一个滚动条下移,导航栏一直在页面顶部的功能,在高速模式下可以实现,但是兼容模式下就不对了,求大神指教
最佳答案
下面是代码
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>position: fixed——webjx.com</title>
<style type="text/css">
* {
padding: 0;
margin: 0;
}
#content {
height: 5000px;
width: 50%;
border-right: 10px dotted red;
}
#demo_t, #demo_b, #demo_l, #demo_r {
background: #f90;
position: fixed;
}
#demo_t, #demo_b {
left: 0;
width: 100%;
}
#demo_l, #demo_r {
width: 50px;
top: 300px;
}
#demo_t {
top: 0;
}
#demo_b {
bottom: 0;
}
#demo_l {
left: 0;
}
#demo_r {
right: 0;
}
</style>
<!--[if lte IE 6]>
<style type="text/css">
html {

background: url(about:black) no-repeat fixed
}
#demo_t, #demo_b, #demo_l, #demo_r {
position: absolute;
}
#demo_t, #demo_b {

width: expression(offsetParent.clientWidth);
}

#demo_l, #demo_r {
top: expre...下面是代码
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>position: fixed——webjx.com</title>
<style type="text/css">
* {
padding: 0;
margin: 0;
}
#content {
height: 5000px;
width: 50%;
border-right: 10px dotted red;
}
#demo_t, #demo_b, #demo_l, #demo_r {
background: #f90;
position: fixed;
}
#demo_t, #demo_b {
left: 0;
width: 100%;
}
#demo_l, #demo_r {
width: 50px;
top: 300px;
}
#demo_t {
top: 0;
}
#demo_b {
bottom: 0;
}
#demo_l {
left: 0;
}
#demo_r {
right: 0;
}
</style>
<!--[if lte IE 6]>
<style type="text/css">
html {

background: url(about:black) no-repeat fixed
}
#demo_t, #demo_b, #demo_l, #demo_r {
position: absolute;
}
#demo_t, #demo_b {

width: expression(offsetParent.clientWidth);
}

#demo_l, #demo_r {
top: expression(offsetParent.scrollTop + 300);
}
#demo_t {
top: expression(offsetParent.scrollTop);
}
#demo_b {
top: expression(offsetParent.scrollTop + offsetParent.clientHeight-offsetHeight);
}
</style>
<![endif]-->
</head>
<body>
<div id="demo_t">此处显示 id "demo" 的内容</div>
<div id="demo_b">此处显示 id "demo" 的内容</div>
<div id="demo_l">此处显示 id "demo" 的内容</div>
<div id="demo_r">此处显示 id "demo" 的内容</div>
<div id="content"></div>
</body>
</html>
建议在实际使用时,将IE条件注释中的代码放在单独的css文件中,以便节约其他浏览器的流量。
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
莲花菩提怎样剥视频
孕妇控制体重的方法是什么???
曲美家具的布艺沙发好不好?有人了解吗?
人体里面有多少是水份
看门狗2联机有意思吗
开源路/X205(路口)地址在什么地方,想过去办
求最新2016年6月1日实行的建筑抗震设计规范
糖耐检查为什么餐后2小时值比餐前值还低呢?
为什么有的时候很困却睡不着?
打工为了什么,人活着为了什么??为了钱,现
淮安哪里有卖洋酒
全运会上,牙买加强人“博尔特”有没有可能被
我的荣耀6喇叭出问题了,怎么维修啊?我放在
帮忙解释一个句子。。谢谢了
N86删除主题怎么清不干净?
推荐资讯
老婆想要个翻盖的手机
关于诺基亚N81手机加锁
我的电脑不能玩游戏
看到过一款水纹屏保,不是苹果系统的,哪里有
婴儿期宝宝的心理发育特征是什么?
黑色衣服被染橘黄色了、怎么办
广西北海有什么好餐厅
世界最长指甲?
晋城游泳池有几个
束缚带哪种好?
开满花的纸条读后感300字
圆通快递到达范围查询
手机登qq时,显示手机磁盘不足,清理后重新登
刺客的套装怎么选啊?