我一直在寻找一种方法让我的“textarea”在它的列中达到 100%。我已经看到了几种不同的方法(我都无法使用)在 Bootstrap 中将“textarea”扩展到 100%。我拥有从自定义内联 CSS 样式到使用 class=“form-control col-lg-12” 到覆盖 Bootstrap 的 CSS 的所有内容。
任何人都有一个可行的建议,允许流体调整大小?
这是我拥有的代码。现在宽度稍微超过占位符文本。
<div class="row">
<div class="col-lg-7">
<h2>@Model.EmployeeName</h2>
<h3>Employee #: @Model.EmployeeNumber</h3>
<h5>(Optional): Exception Log comments related to this shift for your Supervisor/Time Keeper.</h5>
<textarea rows="2" placeholder="Exception Log comments."></textarea>
</div>
<div class="col-lg-5 text-right">
<div ng-controller='TimeCtrl'>
<h2>{{ clock | date:'fullDate'}}</h2>
<h1>{{ clock | date:'HH:mm:ss'}}</h1>
<input type="submit" class="btn btn-xxlarge btn-success" value="Punch In" />
</div>
</div>
</div>
原文由 Caverman 发布,翻译遵循 CC BY-SA 4.0 许可协议
Simply add
form-control
class to yourtextarea
if you want 100% width on it, no need to addcol-lg-12
becauseform-control
class gives the父元素到元素的 100% 宽度。