在 Liferay portlet 中定位表单控件(使用 bootstrap 或其他)

Positioning form controls within a Liferay portlet (using bootstrap or other)

我正在开发一个 portlet,我想使用 bootstrap 让它看起来更漂亮。

我可以正确加载和使用 bootstrap CSS 类 和 JS 脚本。 然而,col-xs-12col-sm-12 ... 类,我通常用来将控件定位到表单中,似乎不起作用。

例如:

<input type="text" class="form-control col-xs-12" id="test" placeholder="teest2">

...不显示宽度为 portlet 宽度的 100% 的输入。 它占 portlet 宽度的 15% 左右。

我该如何解决这个问题?

提前致谢。

经过一番搜索,发现Liferay(现阶段6.2)不支持bootstrap 3. 它只支持 bootstrap2 所以你需要设置控件大小: class = "span12" 到 class = "span1"