为什么bootstrap水平表单失败?

时间:2015-06-25 00:31:59

标签: twitter-bootstrap

enter image description here

如果需要,可以使用更大的图片:http://i.imgur.com/mhjKhQ9.png?1

   <div class="container">
        <div class = "row">
            <div class = "col-md-12">
                <form class="form-horizontal">
                    <div class="input-group">
                        <label for="officeSelection">Office</label>
                        <select data-ng-model="userSelections.office"
                                data-ng-options="o.name for o in officesInOrg"
                                name = "officeSelection"
                                id = "officeSelection"
                                class="form-control"
                                placeholder="Office"
                                ng-change = "officeSelected()">
                        </select>
                    </div>
                </form>
            </div>
        </div>
    </div>
  1. 为什么不维护bootstrap horizontal form format
  2. 如何调整大小(输入字段宽度)。上面链接中的示例不起作用(包含在更多类=&#34; col-md-x&#34; div中),但我认为bootstrap可能在整体上失败,我无法弄清楚这是为什么。

1 个答案:

答案 0 :(得分:0)

显然,“输入组”与“形式组”确实很重要。出于好奇 - 阶级=“形式控制”也是必不可少的。我猜输入组只适用于appending inputs

 <div class="form-group">
                <label for="officeSelection" class="col-md-offset-3 col-md-2 control-label">Office</label>
                <div class="col-md-4">
                    <select data-ng-model="userSelections.officeId"
                            data-ng-options="o.id as o.name for o in selectionOptions.officesInOrg"
                            name = "officeSelection"
                            id = "officeSelection"
                            class="form-control"
                            placeholder="Office"
                            ng-change = "officeSelected()">
                    </select>
                </div>
</div>