<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www./TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www./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:(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>
|