How to change color of the selected item from a Xul listbox?

Tags: css,xul

Problem :

How to change color of the selected item from a Xul listbox?

I've tried something like:

listitem:focus {
    background-color: red;
    color: red;

but nothing happens.. and I'm not finding anything in css or xul doc.. (but I'm still looking).

Any idea?

Solution :

This works:

listitem[selected] { // or listitem[selected=true]
    background-color: red;
    color: red;

listitem[selected] applies to all listitems that have an attribute selected (or an attribute selected that evaluates to true... not quite sure).

    CSS Howto..

    How to fix position of html element label with css?

    JQuery, fade out table row and contents (on scroll) in ratio to how much the row is hidden by containing div

    How to remove white border from blur background image

    How to create DropDown MenuBar using CSS

    How can I mark it up? [closed]

    how to decrease space between headings?

    How to create marquee infinite loop of logos slider with css only

    How to add css files using PHP inside the tag?

    How to design a CSS for floating confirm dialog centered on the visible portion of a page?

    How to set focus/active on the clicked li(tab) in angular.js

    How to get cross browser compatibility in Print on page from all browsers?

    How to style placeholder text color for individual text field?

    How to have separate images for radio buttons - HTML & CSS

    How to use the css height attribute for showing scroll bar in HTML table

    How to achieve following graphics via css

    How to use @page CSS in ASP.NET MVC View

    How to default toggle to open using css/jquery?

    How to get a div text from html content

    How to make sure pressed button remain “pressed down”

    How can i learn CSS easily?

    How to restore color in css after mouse leave?

    How to get the click position on a page when a css zoom is involved

    How to hide specific TD borders in a TABLE using CSS

    How to change height of a dynamically embedded gist?

    Jquery not showing select element. No errors in console

    How to understand CSS Background-Position coordinates

    How can I be sure that a website is responsive by only looking the code?

    How to stop css image slideshow at last image?

    CSS - How to set many div width with a non-round percentage to fill a parent div space

    (HTML/CSS) How to align a text to middle of center (in both x and y axis)? [duplicate]