Hidden input take space in IE
On this page at the bottom in the form to add comments, I have a set of hidden HTML inputs. Works fine, except on IE.
In IE, they take space and move the form down. I suspect it is because there are generic CSS rules for input
, but I'm not 100% sure. If that's the case, how do I make it so that input types "hidden" don't 开发者_C百科get affected by CSS rules? If that's not it, then what's going on?
Use IE Developer Tools( F12
) to find out which object is really taking space.
Add a float: left;
. It'll help.
For IE add conditional tags to handle #content
and .comment-sbt-btn
Do this:
- Remove
width: 100%
from#content
- Clear left the and remove
margin-left
on.comment-sbt-btn
:
clear: left; margin-left: inherit;
This will fix the rendering problem in IE.
I found this worked for me with a hidden submit button in IE
<input type="submit" style="width:0; height:0; border:0; background-color:inherit; overflow:hidden;" />
Maybe it'll work for other types of hidden controls
精彩评论