如果我正在使用,当浏览器大小发生变化时,如何消除空格background-size:contain;
?
对于较小的浏览器尺寸,图像和文本之间的空白太多了。网站是:http: //16debut.com/test.html
CSS是:
body {
margin:0px 0px;
}
#hero {
background-clip: content-box;
background-image: url("imgtop.png");
background-size: contain;
background-repeat: no-repeat;
position: relative;
height: 235vh;
}
#content {
padding: 100px 50px;
text-align: center;
width: 80%;
margin: 0px auto;
}
#content h2 {
margin: 0px 0px 30px 0px;
}
#footer {
padding: 30px 0px;
text-align: center;
background: #ddd;
}