在下面的对话框中我试图让菜单下拉列表对齐电子邮件输入框的右侧?我已经尝试了所有我能想到的东西,但是菜单会向右或向下移动。
DocsAndPositionsEnum payloads = null;
TermsEnum iterator = null;
Terms termVector = reader.getTermVector(docId, "field");
iterator = termVector.iterator(iterator);
while ((ref = iterator.next()) != null) {
payloads = iterator.docsAndPositions(null, payloads, DocsAndPositionsEnum.FLAG_PAYLOADS);
while (payloads.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
int freq = payloads.freq();
for (int i = 0; i < freq; i++) {
payloads.nextPosition();
BytesRef payload = payloads.getPayload();
// do something with the payload
}
}
}
答案 0 :(得分:0)
你需要使用包装器获取电子邮件字段及其标签,并使字段包装器和菜单包装器在css中向左浮动
更改您的HTML:
<div id="dialogNewRecipient" title="Add Recipient">
<div class="row">
<label for="NewFullName">Name:</label>
<input id="NewFullName" type="text">
</div>
<div class="row">
<div class="form-group">
<div class="container">
<div class="form-group">
<label for="NewEmail">Email:</label>
<input id="NewEmail" type="text">
</div>
<ul id="menu" class="nav navbar">
<li class="label"></li>
<li class="dropdown" id="emailDropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" id="dropdownMenu2" aria-haspopup="true" aria-expanded="false">@@tax.ny.gov<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">@@tax.ny.gov</a></li>
<li><a href="#">@@scom.tax.ny.gov</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="form-group center-block">
<button id="SaveRecipient" type="button">Save</button>
<button id="CancelRecipient" type="button">Cancel</button>
</div>
</div>
将此添加到您的CSS代码中:
.form-group, #menu {
display: inline-block;
float: left;
}
这些修改会将菜单放在电子邮件字段的右侧。