2

Fiddle

<select>test</select>
<select>test</select>
<select>test</select>

I'm trying to add stuff between the select elements, but I'm unable to get them aligned properly because select elements naturally have a margin between them. Looking through the computed styles I'm unable to figure out why this is the case.

How do I remove this? Do I have to result to negative margins?

Mathias Rechtzigel
  • 3,450
  • 1
  • 14
  • 36

1 Answers1

4

Select elements are inline-block elements by default and like all inline-block (or inline) elements they have a "white space" between them like inline words in a sentence.

Check this questions for ways to remove that white space or use display:block; to make them block elements without white space.

Demo

Community
  • 1
  • 1
web-tiki
  • 87,261
  • 27
  • 200
  • 230
  • 1
    "...the size of the white space depends on browser." Does it? It depends on the width of the space glyph of the font in use, but if you used a custom font, wouldn't that precisely define the negative margin to use? – Alohci Oct 31 '14 at 15:30
  • @Alohci you are right, I'll remove that sentence, it is wrong – web-tiki Oct 31 '14 at 15:33