【发布时间】:2015-01-30 15:16:56
【问题描述】:
我在这里遇到了问题。如果我保留 form-control 类应用,我可以在键入时看到密码字符(它设置字体前景和背景),但它还将宽度设置为 100%,这使得输入控件太宽。如果它删除了form-control 类,那么我就看不到输入,并且我失去了文本中漂亮的填充效果。有没有干净的方法来解决这个问题?
旧的解决方法是在输入中添加 style="width:100px"。不过,这会破坏小屏幕。我真的需要网格来代替。
<div>
<div class="col-sm-4"></div>
<div class="col-sm-4">
<input
name="sp" type="password"
class="form-control"
required ng-minlength="9" ng-maxlength="255" />
</div>
<div class="col-sm-4"></div>
</div>
参考:http://getbootstrap.com/css/#code
这是一个很好的指南,但似乎所有示例都使用完全展开的输入元素,其中两侧都有另一个可见的输入元素。我在网格中使用空元素来占用空间(以居中)输入。 http://www.tutorialrepublic.com/twitter-bootstrap-tutorial/bootstrap-forms.php
【问题讨论】:
-
"我在网格中使用空元素来占用空间" 不要那样做。改用偏移类。请参阅github.com/twbs/bootlint/wiki/W009 另外,您的示例缺少
<div class="row">
标签: css twitter-bootstrap