我有一张图片作为我的背景,但我不知道如何让我的代码响应,以便在我缩小浏览器窗口时图像保持一致。这是我的代码:
body {
margin-top: 50px;
}
.full {
background: url(../melissa.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
-o-background-size: cover;
}
最佳答案
如果你想要响应式背景
,请看这个SAMPLE
.full {
height: 500px;
background-image: url('image.jpg');
background-position: center top;
background-repeat: no-repeat;
background-size: cover;
}
关于css - 响应图像背景,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30158449/