zoukankan      html  css  js  c++  java
  • 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>

    如果这篇文章对您有帮助,您可以打赏我

    技术交流QQ群:15129679

  • 相关阅读:
    HDU 6194【后缀数组】
    SGU 104 Little shop of flowers【DP】
    POJ 2104 K-th Number【整体二分 + 树状数组】
    HDU 5573 Binary Tree【构造】
    UVA 10245 The Closest Pair Problem【分治】
    POJ 1741 Tree【树分治】
    边缘检测的微分算子简单比较【1】
    HDU 5584 LCM Walk【搜索】
    51nod 1686 第K大区间【离散化+二分】
    HDU 5572 An Easy Physics Problem【计算几何】
  • 原文地址:https://www.cnblogs.com/yeminglong/p/2835689.html
Copyright © 2011-2022 走看看