Select elements treat their 'size' attribute very oddly when their parent has padding. They seem to decide to have a height which is a multiple of the size and some other figure, and inherit the padding of their parent (!). This is very odd to look at. Furthermore, the padding-left is then carried through to the padding-right (!) forcing, if the padding-left is bigger than the -right, a scroll bar to appear. A similar oddity occurs with the -top and -bottom paddings. For example: <p style="padding: 2em"> <select size=4> <option>a</option> <option>b</option> <option>c</option> <option>d</option> <option>e</option> <option>f</option> <option>g</option> </select> </p> In the above, the select element gets 2em padding between its frame and its options, and has a huge height. This is visible on the following test pages: http://www.bath.ac.uk/%7Epy8ieh/internet/projects/mozilla/selectsize.html http://www.bath.ac.uk/%7Epy8ieh/internet/projects/mozilla/optgroup.shtml Explicitly setting the padding on SELECT or OPTION seems to have little or no effect.
Reassigning to Rod.
I thought there was a bug on this already, but I guess not. I did mention this in some check in message. Yes, we don't obey padding or borders and it is a bug problem (code wise) on trying to make this happen. Basically, if you set the border and padding on a select the dropdown picks those style settings and messes all the sizing up. So I will keep this bug open to track this problem, this probably won't be fixed for beta.
rods: I'm not setting padding on the SELECT. I'm setting it on its parent.
Status: NEW → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → DUPLICATE
cleaning up: VERIFY duplicate
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.