在ie下实现position:fixed效果最简单有效的途径

有个限制,一定要设置一下DOCTYPE
  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


给需要fixed的元素加个类名class='fixed'
普通的style里面
div.fixed {
   position; fixed
}
给支持fixed的浏览器
然后加上
  
<!--[if lte IE 6]>
<style type="text/css">
html, body
	{
	height: 100%;
	overflow: auto;
	}
div.fixed {
	position: absolute;
}
</style>
<![endif]-->

你可能感兴趣的:(html,浏览器,IE)