【发布时间】:2017-12-13 04:19:10
【问题描述】:
我有the following landing page form(我已经删除了所有我认为无关紧要的不必要的东西,只留下了最少的样式)。这是代码(我使用的是 Bootstrap 3.3.5):
<div class="col-md-6 app-door">
<form class="image-hover text-center">
<h3>Application name</h3>
<div class="landing-page-form-group">
<label class="landing-page-label">Label: </label>
<input class="form-control landing-page-input">
</div>
<button class="btn">Submit</button>
</form>
<div class="center-block app-link some-img"/>
</div>
..和css
.image-hover {
width: 300px;
height: 300px;
background-color: rgba(0, 0, 0, 0.7) !important;
position: absolute;
z-index: 100;
color: #cccccc;
margin: 0 auto;
left: 0;
right: 0;
border-radius: 25px;
}
.landing-page-form-group {
padding-top: 16px;
padding-bottom: 16px;
}
.landing-page-label {
width: 100px;
vertical-align: middle;
}
.landing-page-input {
width: 150px;
display: inline-block;
}
.app-link {
width: 300px;
height: 300px;
background-size: 100% 100%;
border-radius: 25px;
}
.some-img {
background-image: url("http://dl.hiapphere.com/data/icon/201511/HiAppHere_com_com.ludicside.mrsquare.png");
}
我想将所有表单输入等垂直居中。我已经尝试过诸如使用位置(相对于父级,绝对在子级)、垂直对齐、顶部、也许我现在不记得的其他东西,因为我花了很多时间尝试。
我不是前端开发(我的意思是 html/css)方面的出色专家,所以我会非常高兴看到理解,尽管问题似乎足够基本。
感谢您的任何想法!
【问题讨论】:
-
附上它现在的样子可能会有所帮助,如果你能做一个小提琴就更好了。
-
@Bemmu 请看
the following landing page form文字下的第一个链接
标签: html css twitter-bootstrap alignment vertical-alignment