您的位置:首页 > Web前端 > CSS

【css】修正ie6下不支持position:fixed

2014-08-01 17:28 127 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
</head>
<body>
<style>
.fixed_bar{position: fixed;
top: 0;
_position: absolute;
_top: expression(eval(document.documentElement.scrollTop));
left: 0;
background-color:red;
height:30px;
width:100%;
}
p{height:2000px;}
* html,* html body /* 修正IE6振动bug */{background-image:url(about:blank);background-attachment:fixed;}
</style>

<div class='fixed_bar'>
我是固定 头部
</div>
<p>主题内容</p>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: