How to override CSS Primefaces added via Maven?

Asked

Viewed 671 times

3

I am using Megamenu in my project, but its options are much larger than the width of the columns of this component, so the menu options exceed the area intended for them, which is very ugly.

I added the primefaces via Maven. How do I change the Megamenu CSS so that the columns are wider, change colors, etc?

Or if you don’t need to change the CSS, as I do?

1 answer

3

Simply declare the stylesheet that contains what you need to overwrite after pressing the one on the first faces. Like the one on the first faces will be on <head />, may declare so:

<h:head>
    <!-- normal aqui -->
</h:head>
<h:body>
    <h:outputStylesheet name="sua-folha-de-estilos.css" />
    <!-- segue o corpo da sua página -->
</h:body>

Another way is to use styleClass to configure class(s) with custom style, style to the CSS and so on.

Depending it may be necessary to "force" your style to be applied and not the one of the primefaces, so in the last case you can use !important, but first see how it works precedence style.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.