我正在做一个简单的网站。 在这个网站上,我有几个div在不同的层次(一个在另一个之前等)。 在后面的两个div没有问题,但是当我调整浏览器的大小时,前面的div会移动,我不希望这样。 奇怪的是,后面的div是以相同的方式创建的。 因此,基本上我的网页左右是:#icone_esquerda和#icone_direita。 下面是我的代码:浏览器调整大小时正面div移动
<style type="text/css">
#fundo{
background-image:url("tileable_wood_texture_copy.png");
background-repeat:repeat;
position:fixed;
width:100%;
height:100%;
top:0;
left:0;
}
#frente{
background-image:url("luinguica.png");
background-repeat:no-repeat;
background-position:top center;
position:fixed;
width:inherit;
height:inherit;
left: 0;
top: 0;
z-index:50;
}
#icone_esquerda{
background-image: url("botao_facebook.png");
background-position: bottom center;
background-repeat: no-repeat;
height: 50px;
left: 45%;
margin: -25px 0 0 -25px;
position: fixed;
top: 45%;
width: 50px;
z-index: 60;
}
#icone_direita{
background-image: url("botao_mail.png");
background-position: bottom center;
background-repeat: no-repeat;
position: fixed;
width: 50px;
height: 50px;
left: 53%;
top: 45%;
margin: -25px 0 0 -25px;
z-index: 60;
}
</style>
</head>
<body>
<div id="fundo">
<div id="frente">
<a href="http://www.facebook.com/confrariadaempada">
<div id="icone_esquerda">
</div>
</a>
<a href="mailto:[email protected]">
<div id="icone_direita">
</div>
</a>
</div>
</div>
</body>
当我调整浏览器的div与IDS icone_esquerda和icone_direita移动! 任何人都可以帮助我吗?
在此先感谢。
移动到什么意义上?尝试在[小提琴](http://www.jsfiddle.net)中复制您的问题。 – Terry 2013-04-30 00:01:40
从我在这里看到的,如果你使用%值,它是正常的,因为他们的父母div的大小与窗口宽度 – 2013-04-30 00:10:35