0
所以我有一个块,它应该保持它的位置和比例以适应背景,所以当我调整窗口大小时,块会调整大小,但是背景和块会以不同的方式调整大小。如何让css块在窗口的相同位置调整大小?
html,body {
height:100%;
width:100%;
}
body {
top: 0;
left: 0;
position: fixed;
width: 100%;
height: 100%;
background: url('../img/mainpage/555.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
a#easttoplink {
position:relative;
display:block;
left:40%;
top:26.5%;
background-color: #00ff00;
opacity: 0.3;
width:21.5%;
height:4%;
}
a#easttoplink:hover {
opacity:0.7;
background-color: #ffff00;
}