The*_*ear 0 html css bootstrap-4
所以基本上问题在标题中。当我减小屏幕尺寸时,列会落在下面,但开始与下面的行重叠。
我只是想知道我是否确实缺少某些明显的东西。我似乎找不到适合我的解决方案。
请参阅下面的屏幕截图和代码...
#section-headings {
font-size: 44px;
}
h1 {
text-align: center;
color: #ffffff !important;
}
h2 {
text-align: center;
}
#tag-line {
color: #ffffff !important;
}
#main-header {
margin: 0;
}
.jumbotron {
background-image: url(../images/alaska-landscape.jpg);
background-size: cover;
height: 100vh;
width: 100%;
margin: 0;
}
#services {
background-color: #fC99B0;
height: 100vh;
width: 100%;
margin: 0;
}
#services-col {
padding: 80px;
}
#general-text {
text-align: justify;
}
#about {
background-color: #8589FC;
height: 100vh;
width: 100%;
margin: 0;
}
#previous-work {
background-color: #28292D;
height: 100vh;
width: 100%;
margin: 0;
}
.col-md-6, .col-sm-6 {
border-bottom: 0;
margin-bottom: 0;
margin: 0;
}
#glyphicon-image {
display: block;
margin: 0 auto;
}Run Code Online (Sandbox Code Playgroud)
<!-- Section 2 Services -->
<div id="services" class="container">
<div id="services-row" class="row">
<h1 id="section-headings">services</h1>
<div id="services-col" class="col-md-6 col-sm-6">
<h2>heading 1</h2>
<p id="general-text">paragraph text 1</p>
<img id="glyphicon-image" src="images/bar-chart.png" alt="ux-glyphicon" style="width:128px;height:128px;">
</div>
<div id="services-col" class="col-md-6 col-sm-6">
<h2>heading 2</h2>
<p id="general-text">paragraph text 2</p>
<img id="glyphicon-image" src="images/domain-registration.png" alt="ux-glyphicon" style="width:128px;height:128px;">
</div>
</div>
</div>
<!-- Section 3 About -->
<div id="about" class="container">
<div id="about-row" class="row">
<h1 id="section-headings">about site</h1>
<div class="col-md-6 col-sm-6">
<img src="..." alt="AboutImage">
</div>
<div class="col-sm-6">
<p>Add the about text here and the about image over there <---</p>
</div>
</div>
</div>Run Code Online (Sandbox Code Playgroud)
问题在于您将高度设置为100vh。如
#services {
background-color: #fC99B0;
height: 100vh;
width: 100%;
margin: 0;
}
Run Code Online (Sandbox Code Playgroud)
您可能应该做的是将最小高度设置为100vh(我想您要让一个部分占据整个高度),但不要设置高度和最大高度,如果内容的高度大于在屏幕上,您的元素将变大以适应。
#services {
background-color: #fC99B0;
min-height: 100vh;
width: 100%;
margin: 0;
}
Run Code Online (Sandbox Code Playgroud)