我的标签/输入字段为form-inline
。标签文本已被包装,以便可以对齐表单字段。但是当标签被包裹时,它的相应输入字段是垂直调整的。我该如何解决?
的 HTML
<div class="row-fluid show-grid">
<div class="span6 form-inline"><label class="pocLabel">First Name:</label><input type="text" required/></div>
<div class="span6 form-inline"><label class="pocLabel">Middle Initial:</label><input type="text" /></div>
</div>
<div class="row-fluid show-grid">
<div class="span6 form-inline"><label class="pocLabel">How long with current employer</label><input type="text"/></div>
<div class="span6 form-inline"><label class="pocLabel">Middle Initial:</label><input type="text"/></div>
</div>
<div class="row-fluid show-grid">
<div class="span6 form-inline"><label class="pocLabel">Last Name:</label><input type="text"/></div>
<div class="span6 form-inline"><label class="pocLabel">Social Security Number:</label><input type="text"/></div>
</div>
CSS
.col1 .col2 {
width: 48%;
word-wrap:break-word;
}
label.pocLabel {
width: 200px;
}
.show-grid [class*="span"] {
text-align: left;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
min-height: 40px;
line-height: 40px;
margin-top: 10px;
display: inline;
}
答案 0 :(得分:0)
尝试使用vertical-align:middle;在标签上。