How to change the Home icon in Primefaces Breadcrumb?


Tags: css,jsf,jsf-2,primefaces

Problem :

I would like to change the home icon of the Primefaces Breadcrumb with another icon but I can't find how.

I tried with CSS but it is not working for the icon:

.ui-breadcrumb {
    background: none !important;
    border: none !important;
    icon: url('resources/images/look/bandeau.png')
}


Solution :

It should be enough with:

.ui-breadcrumb .ui-icon-home {
    background-image: url("#{resource['images/look/bandeau.png']}");
    background-position: 0; /* asuming bandeau.png is a single image */
}

But you have to make sure two things:

  • First, that you are overriding primefaces css correctly, you shouldn't need !important. See this. If you are doing it right, at least you will see that the default image dissapear.

  • Second, you have to make sure that you are referring to the image correctly. In my code, I show how I do it myself, but it depends on your configuration so you should also check this.


    CSS Howto..

    How to add css to a HTML div which has no class or id

    How to make a TableLayoutPanel like resizable div in html

    jQuery - how to “reset” a .css() rotated icon?

    How to apply css style on the list of div by defending on the class name using javascript

    How to make div css background hover

    How can I get an image to always appear to the right of some associated text using HTML and/or CSS?

    how is Zurb's Foundation Menu button coded?

    How to route requests in codeigniter so we can serve static css, js and img files?

    CSS: How to center element that is bigger then the container?

    How to Use IF Statement in Play Framework to Use CSS for Only 1 Page

    How to css target “Tab” state of the input?

    Showing responsive menu link that is not shown in regular navigation menu

    I have a standard table with text inside. How do I vertical align this?

    How to apply a CSS style to div AND the div nested in the div [duplicate]

    How to set one CSS rule for two tags?

    how can I set my gradient background in css for full width and height of the page?

    How to make the bootstrap button,when clicked to redirect to a specific page

    How to setup counters for target-counters

    How to know where to use css, less and Sass? [closed]

    How can i get the source of the image in one div to another?

    How to move this structure to the right without using float?

    how to center background image in window resize

    How would I make this into an dynamic :nth-child css selector [duplicate]

    How to position a scroll box on top of an image using only inline CSS

    How do I remove a hover effect if the Element has focus?

    How to set z-index for a shadow (CSS)

    How to Link to Images in CSS file in RoR 3.2 Project?

    How to serve different css files to different ajax pages?

    How do display a CMS collection in an ASP.net page using an XSLT file

    How can I center a div within another div?