每当我的图像达到6或更低的iphone宽度并向左滚动时,就会有一个边距。
我的CSS:
.background-image {
z-index: -1;
position: absolute;
margin: 0px;
height: 40%;
width: 100%;
background:
linear-gradient(rgba(74,74,74,0.21), rgba(74,74,74,0.21)),
url('./img/nyc_quarter.png') no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-position: center;
}
答案 0 :(得分:0)
nav
{
background-color:black;
height:30px;
color:white;
}
#background
{
background-image: url('https://weloveminitel.eu/snow2.jpg');
background-size: cover;
height:200px;
color:white;
display: flex;
justify-content: center;
flex-direction: column;
align-items: stretch;
text-align:center;
}
#bottom
{
height:200px;
border:1px solid black;
}

<body>
<nav>
navbar
</nav>
<div id="background">
some text
</div>
<div id="bottom">
the bottom div
</div>
</body>
&#13;