【发布时间】:2016-09-02 08:20:46
【问题描述】:
我正在和我的朋友创建一个网站。目前我们正在创建一个联系人页面,但我无法将标签与输入框对齐。
我的 ASP.net 代码:
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<title>Contact</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PageContent" runat="server">
<div style="background-color: white; height: 750px;" class="container" id="contact-page">
<label for="InputFullName">Full Name</label>
<input type="text" class="form-control" id="InputFullName" placeholder="Full Name"/>
<label for="InputEmail">Email address</label>
<input type="email" class="form-control" id="InputEmai" placeholder="Example@example.com"/>
<label for="InputSubject">Subject</label>
<input type="text" class="form-control" id="InputSubject" placeholder="Subject"/>
<label for="InputDescription">Description</label>
<input type="text" class="form-control" id="InputDescription" placeholder="Description"/>
<div class="form-actions">
<button type="submit" class="btn btn-default">Submit</button>
</div>
</div>
</asp:Content>
链接到该页面的我的 CSS 文件:
/* Contact Page start */
#contact-page input {
display: block;
width: 450px;
float: none;
margin: 0 auto;
background-color: white;
}
#contact-page .btn btn-default {
float: none;
margin: 0 auto;
}
#contact-page #InputDescription {
height:250px
}
#contact-page label {
display: inline-block;
vertical-align: middle;
float: none;
}
/* Contact Page end */
我正在使用引导程序 3。
【问题讨论】:
-
在标签中添加 line-height 作为输入框的高度
-
您觉得它如何?可以发个截图吗?
-
gyazo.com/84e8ef9bcd416ac4fdccf5c4d741cf59 这是我在atm看到的。
标签: html css asp.net twitter-bootstrap-3