Sam Bickley
Sam Bickley

Reputation: 127

Why don't the elements line up in this html?

I am trying to make a select box element from scratch with a custom theme. When I have overflow:hidden; on line 59 in my css the elements don't line up the way I would expect. However, when I remove that line it does line up the way I would expect but the text will overflow. It does seem to work in chrome but not firefox.

Working:

Working

Not Working:

Not Working

Here is the code: http://jsfiddle.net/nd7Hn/

Why does that happen and how can I fix it?

Upvotes: 0

Views: 53

Answers (1)

Niet the Dark Absol
Niet the Dark Absol

Reputation: 324650

Add this style:

.editor-controls>* {vertical-align:top}

Otherwise elements will try to align to their baseline, which may produce unexpected results.

Upvotes: 4

Related Questions