Some little extra space is being added when a drop-down is on :focus

Posted by catandmouse on Stack Overflow See other posts from Stack Overflow or by catandmouse
Published on 2010-12-22T02:41:41Z Indexed on 2010/12/22 2:54 UTC
Read the original article Hit count: 183

Filed under:
|
|
|
|

My problem is that when I place :focus style for our dropdown lists like so:

input, select {
    margin: 0;
    padding: 0;
}

select:focus  { background: #FFC; }

...the dropdown with the focused selection suddenly has an extra spacing on all sides (1-2px spacing). See images below:

alt text

alt text

It may seem unnoticable on the photos above but when you do a selection, the increase in padding/spacing cannot be missed.

I already tried removing margin: 0, padding: 0, thinking that the :focus state might be reverting to the padded version but still the same. Has anybody encountered this problem?

Only happens in Firefox.

© Stack Overflow or respective owner

Related posts about html

Related posts about css