How to define background for p:menubar in Primefaces?

chows2603 picture chows2603 · Sep 16, 2013 · Viewed 12.2k times · Source

How to define background for <p:menubar> in Primefaces

<p:menubar rendered="#{loginBO.flag=='admin'}" autoSubmenuDisplay="True" style="background-image: url('images/ui-bg_gloss-wave_55_5c9ccc_500x100_png.png')">
    <p:menuitem value="Home" url="/RMGHome.xhtml" icon="ui-icon-home" />
    <p:menuitem value="Filter Search" action="#{leftMenuService.getMenuList}" icon="ui-icon-search" />
</p:submenu>

Answer

Joffrey Hernandez picture Joffrey Hernandez · Sep 16, 2013

Like this:

.ui-menubar,.ui-menu-child,.ui-menu {
    background: #004e8e !important;
}