Internet Explorer Submit Button Horizontal Padding

Bookmark and Share

As you already know Internet Explorer takes great care to interpret HTML and CSS in it’s own special way and only sometimes does this co-incide with the W3C’s specification. The padding on Submit Buttons is one such nuisance.

Simply, IE simply ingores any horizontal padding you specify with css. The solution, I discovered, it to use the “overflow: visible” for all such elements e.g.

Before

<input type="submit" value="Internet explorer ignores my padding" style="padding: 20px;" />


After:
<input type="submit" value="Internet explorer respects my padding" style="padding: 20px; overflow: visible;" />

NB For this example I’ve put the style inline with the html - for real use this should be separated from the html in an external style sheet.

15 Responses to “Internet Explorer Submit Button Horizontal Padding”


  1. 1 Vince Jun 27th, 2007 at 11:19 am

    Thank you for this solution.
    It works very well on IE 6 and 7

  2. 2 Rene Robinson Sep 20th, 2007 at 9:29 pm

    Thanks so much - I have been looking for this for AGES!
    Thanks again.

  3. 3 Amanda C. Apr 7th, 2008 at 4:02 pm

    Thank you so much for putting this out here. I have been looking for a solution to this problem for a current project at work. This works perfectly.

  4. 4 Lenny Oct 27th, 2008 at 8:15 pm

    Oh gee, who would’ve thought it’s as simple as that. Thanks alot for the hint :)

  5. 5 jeep Dec 14th, 2008 at 7:14 pm

    Wohoo big thanks, I have been loking a long time.

  6. 6 Ray Dec 16th, 2008 at 4:28 pm

    Thank you! I was just searching for this.

  7. 7 Eric Jan 19th, 2009 at 11:51 am

    Thank you. Very straight forward fix to another stupid IE bug!
    (:

  8. 8 Ivan Feb 1st, 2009 at 8:53 am

    Just used this. Works well. 1

  9. 9 Jones Mar 4th, 2009 at 10:39 am

    Thanks for that simple solution.
    But is there a way how this works with input[type='button'], too?

  10. 10 robert Mar 12th, 2009 at 1:43 pm

    overflow:visible can trigger sometimes a weird bug in ie7: when you scroll down the page, the button text disappears. Then it appears again, sometimes complete, sometimes as if it was half erased. Really annoying!
    I saw it in action several times. It happens when I set a background image for the input.

  11. 11 Simon Bruce Mar 23rd, 2009 at 12:39 pm

    This seems to be fixed in Internet Explorer 8.

  12. 12 Rollo Mar 24th, 2009 at 11:42 am

    Thanks for saving me hours of annoyance, much appreciated.

  13. 13 Alex May 29th, 2009 at 9:50 am

    @Robert : I had this weird “disappearing content” bug in IE7 too when setting the overflow:visible property on an input submit that has a background image. I changed the value to “auto” (overflow:auto;)and added a text-align:left and it got rid of this problem. Does this work for you ?

  14. 14 Bartezz Jun 8th, 2009 at 9:03 am

    Thanx!

  1. 1 IE7 Ignores Submit Button Padding - Twitter Homepage « XBDiff Blog Pingback on Jun 11th, 2009 at 12:39 am

Leave a Reply




About MrKirkland

more...

Tweets

  • Watching Henry Fool, "I've been bad... Repeatedly", marvelous! 1 day ago
  • @paypal your customer support is far too slow 2 days ago
  • I feel like a spoilt teenager with rich folks, staying up late on a school night, and going to cafes, the gym etc during the afternoon 3 days ago
  • More updates...

Posting tweet...

Timezone

  • JST: 2009-07-04 07:04
  • BST: 2009-07-03 23:04
  • PDT: 2009-07-03 15:04
  • EST: 2009-07-03 17:04