我真的需要您的幫助,以正確的縮進和邊距正確地格式化/放置我的表單域及其標籤。標籤「CATEGORY A」和「CATEGORY B」只是示例文本,但實際上它們會動態地改變它的內容和長度,所以重要的是在它重疊在「Button1」和「Button2」元素之前自動包裝它。我在這裏使用bootstrap使我的字段響應。正確對齊字段
這是實際的設計格式,我想實現:
這是當前的代碼,我有這麼遠。
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="form-group ">
\t <label class="control-label col-xs-6 col-md-3" for="main-field-1">Field 1</label>
\t <div class="form_field col-xs-6 col-md-9 required">
<input class="form-control " id="main-label-1" name="main-field-1" placeholder="Number" title="Enter Value" type="text">
<div class="" style="display:none"></div>
\t </div>
</div>
<div class="form-group ">
\t <label class="control-label col-xs-6 col-md-3" for="main-field-2">Field 2</label>
\t <div class="form_field col-xs-6 col-md-9 required">
<input class="form-control " id="main-label-2" name="main-field-2" placeholder="Number" title="Enter Value" type="text">
<div class="" style="display:none"></div>
\t </div>
</div>
<h4>
Other Fields
</h4><BR><BR>
CATEGORY A <button class="btn btn-primary" style="min-width:55px;margin-right:3px;margin-bottom:3px;padding:3px" title="">Button 1</button><button class="btn btn-primary" style="min-width:55px;margin-right:3px;margin-bottom:3px;padding:3px" title="">Button 2</button>
<div class="form-group ">
\t <label class="control-label col-xs-6 col-md-3" for="main-field-1">Field 1</label>
\t <div class="form_field col-xs-6 col-md-9 required">
<input class="form-control " id="main-label-1" name="main-field-1" placeholder="Number" title="Enter Value" type="text">
<div class="" style="display:none"></div>
\t </div>
</div>
<div class="form-group ">
\t <label class="control-label col-xs-6 col-md-3" for="main-field-2">Field 2</label>
\t <div class="form_field col-xs-6 col-md-9 required">
<input class="form-control " id="main-label-2" name="main-field-2" placeholder="Number" title="Enter Value" type="text">
<div class="" style="display:none"></div>
\t </div>
</div>
CATEGORY B <button class="btn btn-primary" style="min-width:55px;margin-right:3px;margin-bottom:3px;padding:3px" title="">Button 1</button><button class="btn btn-primary" style="min-width:55px;margin-right:3px;margin-bottom:3px;padding:3px" title="">Button 2</button>
<div class="form-group ">
\t <label class="control-label col-xs-6 col-md-3" for="main-field-1">Field 1</label>
\t <div class="form_field col-xs-6 col-md-9 required">
<input class="form-control " id="main-label-1" name="main-field-1" placeholder="Number" title="Enter Value" type="text">
<div class="" style="display:none"></div>
\t </div>
</div>
<div class="form-group ">
\t <label class="control-label col-xs-6 col-md-3" for="main-field-2">Field 2</label>
\t <div class="form_field col-xs-6 col-md-9 required">
<input class="form-control " id="main-label-2" name="main-field-2" placeholder="Number" title="Enter Value" type="text">
<div class="" style="display:none"></div>
\t </div>
</div>
哇,謝謝你,這就是我要尋找:)。對此,我真的非常感激。 – Rocky