【发布时间】:2022-01-25 19:47:56
【问题描述】:
我有一个带有全屏滚动部分的 1 页网站。 每个部分在桌面上都能正确显示,但在移动设备上,“团队”部分的顶部和底部都有一个白色块。
我为团队制作了另一个部分('team2test'),仅在移动设备上使用 - 使用 HTML 尝试使部分全高,但背景图像不是全屏
请协助解释为什么“团队”部分的顶部和底部有间隙 - 或者为什么我的背景图片在“team2test”中不是全屏
“team2Test”的代码:
body,
html {
height: 100%;
margin: 0;
}
.team-images-mobile {
display: block;
margin-left: auto;
margin-right: auto;
padding: 10px;
width: 200px;
height: 200px;
}
.team-section {
background-image: url(https://neuefund.com/wp-content/uploads/2022/01/team_7693a7d4f435b52cec2b4ce8cbbf00a4.png);
background-position: center;
background-size: cover;
background-repeat: no-repeat;
height: 100vh;
width: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
position: relative;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="team-section">
<div class="team-images-mobile">
<img src="https://neuefund.com/wp-content/uploads/2022/01/MAX-300x300.png" alt="" >
<img src="https://neuefund.com/wp-content/uploads/2022/01/KRISH-300x300.png" alt="">
<img src="https://neuefund.com/wp-content/uploads/2022/01/COFIELD-300x300.png" alt="">
</div>
</div>
【问题讨论】: