CSS如何讓背景不能滾動

字號:


    最近學習點樣式表,以前有一位很歷害的CSS朋友給我這個代碼,看的挺不錯的,思想真棒!留個紀念!
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>無標題文檔</title>
    <style type="text/css">
    *{ margin:0; padding:0;}
    html,body{ width:100%; height:100%; overflow:auto; position:relative;}
    .container{ width:100%; height:100%; overflow:auto;}
    .bg{ background:#000000;opacity:0.5; filter:alpha(opacity=50); position:absolute; z-index:1; overflow:auto; width:100%; height:100%; left:0; top:0;}
    .box{ position:absolute; left:50%; top:50%; width:300px; z-index:11; height:300px; line-height:300px; color:#f60; font-weight:bold; font-size:20px;}
    .info{ position:absolute; left:-50%; top:-50%; z-index:10; width:300px; height:300px; text-align:center; border:1px solid #f00; background:#fff;}
    </style>
    </head>
    <body>
    <div>
    <script type="text/javascript">
    for(var i=0;i<150;i++){
    document.write('<center>大力開發(fā)建設蝶戀蜂狂就愛上了開發(fā)簡單說了開發(fā)經(jīng)理的薩克減肥啦可適當加分</center>');
    }
    </script>
    </div>
    <div></div>
    <div><div>我就不動</div></div>
    </body>
    </html>