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;
}