避免浏览器调整大小时的div移动

时间:2015-10-16 08:03:48

标签: html css

爵士  有一个父div,里面包含另一个div。我把它放在距离顶部约200px的窗口中心。但是当我调整浏览器的大小时,整个div会相应地移动。我希望div不应该在浏览器大小调整上移动。

以下是完整页面:



<!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=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
#animationblockcontainer{position:absolute;margin-left:auto;margin-right:auto; width:1033px;height:300px;border:solid 0px red;left:0;right:0;bottom:0;top:200px; min-width:1033px;}
.leftpanel1 {
    width: 280px;
    height: 270px;
    background: #ccc;
	position:absolute;
	float:left;
	z-index:100;
	top:0;
  }
  .rightpanel1 {
    width: 682px;
    height: 270px;
    background: #ccc;
	position:absolute;
	float:right;z-index:100;top:0;right:0;
  }
 
.stylecell{border:solid 2px #1d80d5; background:#fff;}
.stylepad{padding:15px;}
.boldtext{font-family:"trebuchet MS"; font-size:25px; font-weight:700; color:#003a6c; line-height:1.1;}
.normaltext{font-family:"trebuchet MS";font-size:20px; line-height:1.1;color:#01386e;}

 </style>
</head>

<body bgcolor="#474747">
  <div id="animationblockcontainer">
                      <div id="toggle1" class="leftpanel1 stylecell stylepad">Image Here</div><div id="toggle2" class="rightpanel1 stylecell stylepad"><span class="boldtext">bolded text bolded text bolded text bolded textbolded text bolded text</span><br/>
					   <span class="nomraltext">normal text normal text normal text normal text normal text normal text normal text </span>
					   </div>
                    </div>
</body>
</html>
&#13;
&#13;
&#13;

0 个答案:

没有答案