我在模式框内有表单,其中包含输入字段和纯文本的组合。我想知道这种情况下引导程序的一般规则是什么。元素应该如何组织?我应该使用<div class='form-group'>
所有东西还是可以使用<div class='row'><div class='col-xs-12'>
例如?这是我到目前为止所拥有的:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.0/js/bootstrap.min.js" integrity="sha384-7aThvCh9TypR7fIc2HV4O/nFMVCBwyIUKL8XCtKE+8xgCgl/PQGuFsvShjr74PBp" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.0/css/bootstrap.min.css" integrity="sha384-PDle/QlgIONtM1aqA2Qemk5gPOE7wFq8+Em+G/hmo5Iq0CCmYZLv3fVRDJ4MMwEA" crossorigin="anonymous">
<div id="myModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h5 class="modal-title">Title</h5>
</div>
<div class="modal-body">
<form id='frm_my'>
<div class='row'>
<div class='col-xs-12'>Frm validation rules in description here. Dummy text for testing purpuse.</div>
</div>
<div class='row'>
<div class='col-xs-1'><input type='checkbox' name='check' id='check'></div>
<div class='col-xs-11'>Field 1 description with some dummy text (example)</div>
</div>
<div class='row'>
<div class='form-group'><label for='comment'>Comment:</label><textarea class='form-control' rows='2' id='comment'></textarea></div>
</div>
<div class='row'>
<div class='col-xs-12'>Click on the Accept button if you would like to save the form data. <b>Accept</b>.</div>
</div>
<div class='row'>
<div class='col-xs-12'>To cancel this screen and return to the display screen, click <b>Cancel</b></div>.
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Accept</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
另外,我想知道是否有一种方法可以在表单周围添加填充,因此它不在模态框的边缘旁边?谢谢你。