【发布时间】:2017-04-24 20:08:10
【问题描述】:
我有一个带有网格布局的模式,因为我将标签放在每个字段上方。这主要是可行的,但它们会填充整个模态,一直到左/右边缘。 bootstrap site 的演示似乎没有那么麻烦,但这些是文本字段而不是标签。我玩弄了表单控制类,但这似乎使事情变得更糟。有没有我错过的课程?
这是我的代码的 JSfiddle:https://jsfiddle.net/jdnag6zx/
<!DOCTYPE html>
<html>
<!--https://jsfiddle.net/jdnag6zx/-->
<head>
<title>Bootstrap 3</title>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<body>
<a href="#dates" class = "btn btn-default" data-toggle="modal">Dates</a>
<div id="dates" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<form class="form-horizontal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4>New Map</h4>
</div>
<div class="modal-body">
<div class="row">
<label for="column-type" class="col-lg-4 control-label">Date</label>
<label for="column-type" class="col-lg-4 control-label">Separator</label>
<label for="column-type" class="col-lg-4 control-label">Example</label>
</div>
<div class="row">
<select class="col-lg-4" id="date-format" >
<option>1/1/2017</option>
<option>2/1/2017</option>
<option>3/1/2017</option>
</select>
<select class="col-lg-4" id="date-separator">
<option>/</option>
<option>-</option>
</select>
<input class="col-lg-4" id="date-example" value="1-1-2017"></input>
</div>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-primary pull-right" data-dismiss="modal">Close</a>
<a href="#" class="btn btn-success fcvt-btn-save" ng-click="onSubmit()">Continue</a>
</div>
</form>
</div>
</div>
</div>
<body>
<script src="https://code.jquery.com/jquery-3.1.1.js"
integrity="sha256-16cdPddA6VdVInumRGo6IbivbERE8p7CQR3HzTBuELA="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</html>
【问题讨论】:
-
不确定你想完成什么,但我最好的办法是:jsfiddle.net/jdnag6zx/4
标签: javascript jquery css twitter-bootstrap bootstrap-modal