【css】修正ie6下不支持position:fixed
<!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>