Closed Bug 56451 Opened 24 years ago Closed 23 years ago

Default selected option does not display style-set color

Categories

(Core :: Layout: Form Controls, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 79107

People

(Reporter: scott.jones, Assigned: rods)

References

()

Details

From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.14-5.0 i686; en-US; m18) Gecko/20001010 BuildID: 2000101015 When I have a "select" element in a standard HTML form, I have found that when the option is the default selected option, the style-set color is ignored (and displayed in black). See my example at http://63.207.138.180/z_bugDemo.html... Reproducible: Always (also happens in Windows) Steps to Reproduce: 1. Browse my example page, http://63.207.138.180/z_bugDemo.html. Actual Results: Each of the default selected options is displayed in black. Expected Results: Each of the default selected options should appear in their respective colors... This HTML reproduces the problem: <form> <select> <option selected style="color:red;">First option (red)</option> <option style="color:green;">Second option (green)</option> <option style="color:blue;">Third option (blue)</option> </select> </form>
hmm... Here is how Mozilla currently sets the selected option element color: option[-moz-option-selected] { color: red !important; background-color: WHATEVER THE BACKGROUND HIGHLIGHT COLOR YOU WANT !important; } THis is specific to mozilla since there is no standard method in css yet. Although , if you read up on the w3.org css3 spec there are hints of how it could work for all supporting browsers in the future. Marking invalid.
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → INVALID
See also bug 79107, Styles assigned to OPTION elements aren't used for pull-down SELECT lists.
This bug is not invalid. The test page (assuming it bears any degree of similarity to the snippet posted in comments, since the link is dead) uses valid CSS and the browser should make every effort to display the author's styles properly regardless of the circumstances. Changing to a dup of bug 79107 with functional testcase.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
*** This bug has been marked as a duplicate of 79107 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago23 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.