views:

49

answers:

2

Is it possible to remove the dotted line surrounding a selected item in a select element?

alt text

I have tried to add the outline property in CSS but it did not work, at least not in FF.

<style>
   select { outline:none; }
</style>
+2  A: 

In general, form controls are impossible to style to that degree of accuracy. There's not browser I'm aware of that supports a sensible range of properties in all controls. That's the reason why there're a gazillion JavaScript libraries that "fake" form controls with images and other HTML elements and emulate their original functionality with code:

http://www.webstuffshare.com/2010/03/stylize-your-own-checkboxes/

http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/

http://lipidity.com/fancy-form/

...

Álvaro G. Vicario
Thx, I guess I have to "make my own" select list to accomplish this. Too bad that form controls isn't more uniform across browsers.
Martin
@Martin: this is nothing compare to the inflexibility of a file upload control, which cannot be styled *at all* in most browsers. ;)
MainMa
A: 

Try one of these:

a:active {
 outline: none;
 -moz-outline: none;
}

a {
-moz-user-focus: none;
}

Reference

Catfish
Thx for the effort, but unfortunatly it did not work. Maybe it works on a `a` element, but it did not work on a `select` element.
Martin