您當(dāng)前位置:圖趣網(wǎng)(Tuquu) >> 網(wǎng)頁(yè)設(shè)計(jì)教程 >> 移動(dòng)前端 >> 瀏覽設(shè)計(jì)教程

CSS如何讓背景不能滾動(dòng)

 最近學(xué)習(xí)點(diǎn)樣式表,以前有一位很歷害的CSS朋友給我這個(gè)代碼,看的挺不錯(cuò)的,思想真棒!留個(gè)紀(jì)念!

<!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=gb2312" />
<title>無(wú)標(biāo)題文檔</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 class="container">
<script type="text/javascript">
for(var i=0;i<150;i++){
document.write('<center>大力開(kāi)發(fā)建設(shè)蝶戀蜂狂就愛(ài)上了開(kāi)發(fā)簡(jiǎn)單說(shuō)了開(kāi)發(fā)經(jīng)理的薩克減肥啦可適當(dāng)加分</center>');
}
</script>
</div>
<div class="bg"></div>
<div class="box"><div class="info">我就不動(dòng)</div></div>

</body>
</html>

[教程作者:佚名]
免責(zé)聲明:本站文章系圖趣網(wǎng)整理發(fā)布,如需轉(zhuǎn)載,請(qǐng)注明出處,素材資料僅供個(gè)人學(xué)習(xí)與參考,請(qǐng)勿用于商業(yè)用途!
本文地址:http://irelandcustomcontracting.com/tutorial/wd2233.html
上一篇:CSS層疊順序
CSS層疊順序
完全css彈出菜單
圖趣網(wǎng)微信
建議反饋
×