Is it possible to change the border color on a <select/>
element in an HTML form?
The border-color
style works in Firefox but not IE.
I could find no real answers on Google.
Is it possible to change the border color on a <select/>
element in an HTML form?
The border-color
style works in Firefox but not IE.
I could find no real answers on Google.
Works for me.
No, the
<select>
control is a system-level control, not a client-level control in IE. A few versions back it didn't even play nicely-with z-index, putting itself on top of virtually everything.To do anything fancy you'll have to emulate the functionality using CSS and your own elements.
You can set the border color in IE however there are some issues.Argh... I could have sworn you could do this... just tested and realized I wasn't correct. The notes below still apply though.
in IE8 (Beta1 -> RC1) changing the border color or the background color/image causes a de-theming of the control in WindowsXP (the drop arrow and box look like Windows 95)
you still can't style the options within the select control very well because IE doesn't support it. (see bug #291)
I would consinder enclosing that select block within a div block and setting the border property like so:
You should be able to play with that to accomplish what you need.
As Diodeus stated, IE doesn't allow anything but the default border for
<select>
elements. However, I know of two hacks to achieve a similar effect :Use a DIV that is placed absolutely at the same position as the dropdown and set it's borders. It will appear that the dropdown has a border.
Use a Javascript solution, for instance, the one provided here.
It may however prove to be too much effort, so you should evaluate if you really require the border.