views:

55

answers:

3

I have a set of radio buttons within a table cell. The table cell's background color differs from the page background.

Based on another input, I sometimes disable one or more radio buttons. When disabled, the interior of the radio button assumes the table cell's background. The circle coloring grays out a bit. This combines to make the button look like it "disappeared". Closer inspection shows it to still be there.

I've been struggling to define a CSS entry to change the appearance of the disabled radio button... can it be done? Currently, I'm doing something like this:

.radio {
    background-color: #FFFFFF;
}

.radio:disabled {
    background-color: #FFFFFF;
}

Will I have to resort to images?

UPDATE It's not the background that's the problem, but the interior of the button. When disabled the interior of the button takes on the background color of the table cell... ooh, here's an idea. I change both the table cell and the radio button.

A: 

You can use the CSS attribute selector [attributename] for this.

.radio[disabled] {
    background-color: #FFFFFF;
}
BalusC
Just to mention that attribute selectors do not work in IE6, better to use a specific class in the css file that you can then reference. This way you can make sure that disabled styling works for all browsers.
Brian Scott
Also, it's possible for an element to *have* the "disabled" attribute, but for its value to be `false`.
Pointy
@Brian: I don't care about IE6 anymore wrt non-functional issues ;) @Pointy: I've HTML in mind, not XHTML. Its value can btw also be `disabled`, i.e. `disabled="disabled"`. How annoying, that XHTML ;)
BalusC
A: 

Try adding the border colour as i believe thats the initial edge styling.

border-color #ffffff;

Also you might want to set the border to have no edge styling.

border: 0px solid #ffffff;

Or something along them lines!

RobertPitt
A: 

Replace them with background images.

reisio