这是一段带有 textarea
的 erb 代码。我使用 style="min-width: 100%"
使区域扩展到 100% 宽度。但是 style
根本不起作用。
<div class="container-fluid">
<div class="col-md-8">
<!--panel-->
<div class="panel panel-primary">
<div class="panel-body">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-sm-<%=BUTTONS_CLS['left-span#']%> form-group">
<b><%=t('Batch#')%></b>
</div>
<div class="col-sm-<%=BUTTONS_CLS['right-span#']%> form-group">
<textarea class="form-control" rows="1" id="comment" style="min-width: 100%"><%= @part_production.requirement %></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
这里是 textarea
的 html 源代码:
<div class="col-sm-5 form-group">
<textarea id="comment" class="form-control" rows="1" style="min-width: 100%"></textarea>
</div>
如何设置文本区域的宽度(面板的百分比。不指定特定像素)?
最佳答案
使用 col-sm-12
像这样
<div class="col-sm-12 form-group">
<textarea id="comment" class="form-control" rows="1" style="min-width: 100%"></textarea>
</div>
可能它不会获得 100% 百分比的原因是因为 col-sm-5
类。
关于css - rails : How to set width for a textarea in bootstrap 3 panel?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42128251/