Removing gutters from p:layout

不问归期 提交于 2019-12-24 11:50:41

问题


I'm using PrimeFaces 5.0. I'm having a trouble setting gutter in <p:layout>.

<p:layout id="templateLayout" fullPage="false">

    <p:layoutUnit id="header" position="north" size="155" gutter="0">
    </p:layoutUnit>

    <p:layoutUnit position="west" id="leftPanel" size="225" gutter="0">
    </p:layoutUnit>

    <p:layoutUnit position="east" size="200" gutter="0">
    </p:layoutUnit>

    <p:layoutUnit id="content" position="center" size="2500"
                  style="z-index: 1;" maxSize="2500" gutter="0">
    </p:layoutUnit>

    <p:layoutUnit id="footer" position="south" size="90" gutter="0">
    </p:layoutUnit>

</p:layout>

Event though the gutter attribute is set to 0 everywhere, the gutters between <p:layoutUnit> are not removed. The only gutter which is removed is between the east and the center units.

Tried to apply the following CSS alternatively.

.ui-layout-unit {
    padding-top: 0 !important;
    padding-right:  0 !important;
    padding-bottom:  0 !important;
    padding-left:  0 !important;
}

and

.ui-layout-resizer, 
.ui-layout-resizer-north, 
.ui-layout-resizer-open,
.ui-layout-resizer-north-open {
     height:0px !important;
}

But that did not make a difference either.

How to remove all gutters from <p:layout> then?


回答1:


I just had the same problem.

What I did was using the following properties in the layoutUnit component:

collapsible="true" gutter="0"

It seems that gutter doesn't work unless you use it with collapsible.

The credit goes to the good people of Primefaces Forum:

Layout Unit Gutter Has No Effect @PrimefacesForum



来源:https://stackoverflow.com/questions/25215861/removing-gutters-from-playout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!