简要咨询咨询QQ网站导航网站搜索手机站点联系我们设为首页加入收藏 

css如何让背景不能滚动

来源:易贤网   阅读:1172 次  日期:2016-06-27 10:46:46

温馨提示:易贤网小编为您整理了“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 class=container>

<script type=text/javascript>

for(var i=0;i<150;i++){

document.write('<center>大力开发建设蝶恋蜂狂就爱上了开发简单说了开发经理的萨克减肥啦可适当加分</center>');

}

</script>

</div>

<div class=bg></div>

<div class=box><div class=info>我就不动</div></div>

</body>

</html>

更多信息请查看网页制作
点此处就本文及相关问题在本站进行非正式的简要咨询(便捷快速)】     【点此处查询各地各类考试咨询QQ号码及交流群
上一篇:mysql大小写敏感的问题
下一篇:访问者模式讨论篇:java的动态绑定与双分派
易贤网手机网站地址:css如何让背景不能滚动
由于各方面情况的不断调整与变化,易贤网提供的所有考试信息和咨询回复仅供参考,敬请考生以权威部门公布的正式信息和咨询为准!