开发者

Hidden input take space in IE

开发者 https://www.devze.com 2023-03-19 08:28 出处:网络
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.

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:

  1. Remove width: 100% from #content
  2. 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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号