Jump to content
iwato

Set the Background and Text Color of the <optgroup> Element in Firefox

Recommended Posts

BACKGROUND:  Please compare the Select Language <select> element option menu under the headings Free Webinar and Newsletter/Subscribe found in the navigation bar on the Grammar Captive main page.  Therein lies the heart of the following question. 

QUESTION:  How does one set the background and text colors of the <optgroup> element so that they appear properly in Firefox?

Neither

optgroup {
	background: black;
	color: white;
}

nor

optgroup {
	background-color: black;
	color: white;
}

appear to work.

Roddy

Share this post


Link to post
Share on other sites

appear => appears

Sorry, the host of Grammar Captive errs on occasion.

Roddy

Share this post


Link to post
Share on other sites

The styling of form elements is very restricted. You can read more about it here: https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Styling_HTML_forms

You can't style optgroup elements. If it's very important to give style to a structure similar to that one you'll have to create your own imitation of a dropdown using Javascript.

  • Like 1

Share this post


Link to post
Share on other sites

Yeah, i discovered that Firefox has the element locked. Does this mean that I have to reformat the background color in order to get the element to perform?  The text is simply impossible to read.

Roddy

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...