(@_@;)我是程序猿,我编程,我快乐,知识改变命运,技术成就梦想   oh yeah!合作VX "w6668263" 联系Email:ye583025823@126.com

position:fixed——IE条件注释解决方案

<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>position:fixed——IE条件注释解决方案</title>
<style type="text/css">
<!--
body {margin: 0; padding:0}
p{ height:50px}
.fixed {padding: 10px; background: #000; left: 0px;  color: #fff;  position: fixed; top:0; }
-->
</style>
<!--[if IE 6]>  
<style type="text/css">*/
html{overflow:hidden;}
body{height:100%;overflow:auto;}
.fixed{position:absolute;}
</style>
<![endif]-->
<!--[if lt IE 6]>
<style type="text/css">
.fixed{position:absolute;top:expression(eval(document.body.scrollTop + 50));}
</style>
<![endif]-->

</head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
<div class=fixed>position: fixed;我始终在屏幕左上角哦</div>
<div>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P>
<P>这是为了增加高度</P></div>
</body>
</html>

 

posted on 2012-12-27 14:45  一个草率的龙果果  阅读(264)  评论(0编辑  收藏  举报

导航