Why do my HTML form elements move around when clicking on them in IE8?

DecafJava picture DecafJava · Aug 6, 2012 · Viewed 12.4k times · Source

I have an HTML form with a bunch of input fields (of type text and select). I am floating them such that there are two on each row. In all browsers (including IE7), everything works okay, but for some reason in IE8, whenever I click inside any of the fields or their labels, that field or a surrounding one vertically moves up or down. The position then returns to normal once I click away from the box, though then another nearby box might move. Also, not all of the textbox fields have this issue, and clicking the same textbox doesn't always cause this issue. Any ideas?

Answer

abc123 picture abc123 · Aug 31, 2012

I had the exact same problem, and to fix it, I set

display:block

On the element that was jumping around and that fixed it. Hope that helps.