Forum Moderators: not2easy

Message Too Old, No Replies

What's the deal with CSS and SELECT element?

Browser compatiblity with CSS and SELECT element

         

The_Warden

3:53 pm on May 28, 2003 (gmt 0)

10+ Year Member



I've read a lot about applying CSS to the SELECT element but never have found an absolute answer. At present I've only been able to apply a background color successfully and alter the padding. In IE v6.x I can't even get it to bold the text. In IE/Mozilla I've yet to get it to change the look of the border-style. It would be nice to be able to at least change the border-style so the SELECT element would match the rest of my style.

Is there something I'm missing here or is browser compatibility for CSS with SELECT element just not there yet?
What properties of CSS can you apply to the SELECT element?
Which browsers support it?

Any insight would be greatly appreciated!

BlobFisk

3:56 pm on May 28, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



IE lets you change the backgound colour, Opera and Mozilla will also change the text to you liking, Mozilla also supports borders!

I generally stick to just the background and the font. Although, I do this sparingly for usability reasons.

The_Warden

4:14 pm on May 28, 2003 (gmt 0)

10+ Year Member




IE lets you change the background colour, Opera and Mozilla will also change the text to you liking, Mozilla also supports borders!

I generally stick to just the background and the font. Although, I do this sparingly for usability reasons.

I discovered that. Does Mozilla support border-style? Mmmm.. can't seem to get this style to apply then. The style should create a solid dark grayish border with a background of gray and making it look flat instead of 2D. Works fine on INPUT and TEXTAREA elements.

INPUT, SELECT, TEXTAREA { background-color: #EEEEEE; font-family: verdana; border: #778899 1px solid; font-size: 12px; color: #000000; padding-top: 1px; padding-bottom: 1px; padding-left: 3px; padding-right: 0px; overflow: auto; width: auto; }

moonbiter

8:43 pm on May 28, 2003 (gmt 0)

10+ Year Member



MSDN has what is probably the definitive info [msdn.microsoft.com] on the MSIE implementation of the select element. Also of note [msdn.microsoft.com]:

Except for background-color and color, style settings applied through the style object for the option element are ignored. In addition, style settings applied directly to individual options override those applied to the containing SELECT element as a whole.

Unfortunately, I know of no equivalent reference for Mozilla or Opera.

The_Warden

3:57 am on Jun 7, 2003 (gmt 0)

10+ Year Member



Mmm... this is odd. If you an put CSS on input elements why not SELECT / OPTION elements? There must be away... but then again maybe that support is lacking. You would think a border-style would be possible.

Thanks for your guys input, still wish I could figure out more but thanks. I appreciated the replies.