views:

511

answers:

3

I want to style the actual items in a list box based on certain user input (adding new items, editing existing items, and then making them active/inactive). One thing I wanted to do was use bolding (for active) and italics (for edited items), by simply adding a css class to the list item in question (or taking it away as appropriate).

In Firefox, this work.

In IE7, none of it works.

Why? Is this a quirks mode thing, or did the Dark Gods of IE7, in their unspeakable and infinite madness, decree this must not be? Is Firefox violating the Geneva Convention in doing this?

Here is my css class for bolding purposes:

.active
{
    color:Black;
    font-weight: 600;
}

I tried "bolder" for font-weight as well, just as an attempt to be thorough. That didn't work, which I am sure will come as no surprise to more than one person here.

+3  A: 

IE and firefox implement tags differently.

In IE, what you are asking for isn't possible.

Zack
The saddest face.James Mahoney is probably right that I'm wasting time with this anyway. I'll figure out another way to do it. Thanks for the heads up.
peacedog
+2  A: 

You cannot do this at the moment. Multiple browsers don't support this feature. As an alternative, you can use javascript to replace a standard checkbox with a styled one.

Some jQuery select checkboxes to show the possibilities:

Scharrels
I think I can style it well enough without needing to go for an alternate control. I just thought bold.italics would be simple and easy. Still, those are interesting links, thanks.
peacedog
+1  A: 

Many times that people want to style option elements, they really are wanting optgroups. Will that work for your needs? http://www.w3schools.com/tags/tag_optgroup.asp

If you must have full CSS control over the options, then most javascript libraries have a fully javascript-built select box simulator, which you can then style to your heart's content. http://www.ajaxupdates.com/jquery-select-box/

For me, history has shown that users don't care or even notice the extra styling. But it makes the designers happy :)

James Maroney
I don't think option groups will quite do what I want (separating things into existing/edited/new might look nice, but visual order is important here), but that's an interesting idea.You're probably right that I'm wasting time doing this anyway.
peacedog