【发布时间】:2017-06-09 15:20:41
【问题描述】:
我正在尝试设计一个登录页面,其中不同部分具有不同的背景颜色。第一个部分容器(棕色背景)是一个用于定位子元素的 Flexbox。在第一部分下方是另一个容器(蓝色背景),它也跨越了页面的整个宽度。
问题:两个容器之间有一些空白,我无法删除。
body {
margin: 0;
}
.about-container {
width: 100%;
height: 490px;
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
background: #605B56;
}
#title {
font-size: 28px;
font-weight: 200;
color: #8EB8E5;
}
.pic {
width: 200px;
height: 200px;
border-radius: 50%;
background: #8EB8E5;
}
p {
text-align: right;
color: $white;
}
h3 {
text-align: center;
}
.section-container {
background: #8EB8E5;
}
<div class="about-container">
<div class="about-text">
<h3 id="title">Title</h3>
<p> Lorem ipsum dolor sit amet</p>
</div>
<div class="pic"></div>
</div>
<div class="section-container">
<h3>
Section Title
</h3>
Some text for the next section
</div>
JSFiddle:https://jsfiddle.net/z4oecan1/
【问题讨论】: