Change color of commandButton?

Asked

Viewed 1,297 times

0

I would like to change the color of a commandButton, actually several, wanted to leave set "edit", "delete"... etc

My code is like this.

<p:commandButton icon="ui-icon-trash" actionListener="#{MBFabricante.prepararExcluir}"
    oncomplete="PF('dlgFabExcluir').show();"
    update=":frmFabExcluir:pnlFabExcluir" />

I wanted to change the color of the icon

  • Since you are using a component of the primefaces, one possibility would be to detect the CSS classes responsible for the customization of the button in the framework.

  • Which I couldn’t, because without access to it

1 answer

2

Use the class .ui-button of primefaces, see in the example:

.ui-button{
    background: red !important;
}

The result: inserir a descrição da imagem aqui

In this example I use an external . css file. You can check that this class is in Documentation of the Primefaces.

  • Those cases that the !important helping.

Browser other questions tagged

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