我很难让 form:checkboxes 的 element 属性为 CSS 类 .row-fluid1
JSP代码是
<h:field path="configuredChannels" required="true"
code="admin.menu.channels">
<div class="row-fluid" data-channel-checkboxes="#" style="row-fluid1">
<form:checkboxes element="div class='span1 row-fluid1'"
items="${channels}" path="configuredChannels" />
</div>
</h:field>
CSS代码是
<style type="text/css">
.row-fluid1 [class*=span]
{display:block;
width:100%;
min-height:30px;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
float:left;
margin-left:3.4482758620689653%;
}
</style>
请让我知道我错过了什么
最佳答案
<h:field path="configuredChannels" required="true" code="admin.menu.channels">
<div class="row-fluid" data-channel-checkboxes="#" style="row-fluid1">
<form:checkboxes element="div" cssClass="span1 row-fluid1" items="${channels}" path="configuredChannels" />
</div>
</h:field>
我希望像上面这样的东西能起作用。您在 div 中也有一个 div,它(如果我没记错的话)和 bootstrap(由于该行)在左侧/右侧添加了一个填充/边距。
关于css - 表单 :checkboxes in Spring MVC 的元素属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19094134/