【发布时间】:2017-08-23 17:20:33
【问题描述】:
所以我正在制作的这个网站的肖像模式全都搞砸了。目前看起来像这样:
我想要的只是让手表垂直居中,这是在普通桌面视图中。
HTML:
<header>
<div class="container">
<div class="row">
<div class="col-sm-7 col-md-7 col-xl-7 col-lg-7">
<div class="header-content">
<div class="header-content-inner">
<h1>One for all. All for you.</h1>
<!-- <a href="#download" class="btn btn-outline btn-xl page-scroll">Start Now for Free!</a> -->
</div>
</div>
</div>
<div class="col-sm-5 col-md-5 col-xl-5 col-lg-5" style="height: 100%">
<div class="device-container vertical-align">
<div class="cycle-slideshow" data-cycle-timeout="1500" data-cycle-transition="1500" data-cycle-fx="fadeout" data-cycle-pause-on-hover="#er-pauser">
<img class="img-responsive device-img center-block" src="img/landing2.png" alt="">
<img class="img-responsive device-img center-block" src="img/landing1.png" alt="">
<img class="img-responsive device-img center-block" src="img/landing3.png" alt="">
<img class="img-responsive device-img center-block" src="img/landing5.png" alt="">
<img class="img-responsive device-img center-block" src="img/landing4.png" alt="">
<img class="img-responsive device-img center-block" src="img/landing6.png" alt="">
</div>
</div>
</div>
</div>
</div>
</header>
CSS:
header {
position: relative;
width: 100%;
min-height: auto;
overflow-y: hidden;
background: #47c0d7; /* Old browsers */
background: -moz-linear-gradient(top, #47c0d7 0%, #e6f9ff 55%, #e6f9ff 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, #47c0d7 0%,#e6f9ff 55%,#e6f9ff 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, #47c0d7 0%,#e6f9ff 55%,#e6f9ff 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#47c0d7', endColorstr='#e6f9ff',GradientType=0 ); /* IE6-9 */
}
header .header-content {
text-align: center;
padding: 100px 0px 0px;
position: relative;
}
header .header-content .header-content-inner {
width:100%;
text-align: center;
position: relative;
/* max-width: 500px;
*/ margin: 0 auto;
}
header .device-container {
/* max-width: 400px;*/
height: 100%;
/* margin: 100px auto;
*/}
header .device-img {
left: 0;
right: 0;
width: 100%;
margin: 0 auto;
width: 300px;
}
@media (min-width: 768px) {
header {
min-height: 100%;
}
header .header-content {
text-align: center;
padding: 0;
height: 100vh;
}
header .header-content .header-content-inner {
text-align: center;
max-width: none;
margin: 0 auto;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 100%;
}
.about-content .about-content-inner {
text-align: justify;
max-width: none;
position: relative;
top: 50%;
transform: translateY(-50%);
}
header .header-content .header-content-inner h1 {
margin-top: 0;
margin-bottom: 30px;
font-size: 55px;
color: #363939;
text-align: center;
}
.about-content .about-content-inner h3 {
font-size: 20px;
font-weight: 400;
}
header .device-container {
/* max-width: none;
max-height: calc(0vh);
margin: 100px auto 0;*/
padding: 0;
height: 100vh;
}
它所在的列的高度不是 100%,它所在的容器(设备容器)似乎也没有容纳它的内容。
非常感谢您的帮助。抱歉有这么多评论出来的东西。另外,如果有人知道为什么导航栏会延伸到页面之外,从而使右侧的浅蓝色列发生,请也告诉我。
【问题讨论】:
-
手表在桌面视图中没有垂直居中。您能否在BootPly 之类的东西上创建一个minimal, complete, and verifiable example,它同时显示所需的视图和不希望的视图?我感觉问题出在第 114 行,您在
.device-container的.device-container上设置了height的height768px,但无法确定不能重新创建问题。
标签: html ios css twitter-bootstrap ipad